Click here to Skip to main content
15,887,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
Questionsign in Popup like codeproject.com Pin
RA|-|UL PATEL6-Nov-12 1:27
RA|-|UL PATEL6-Nov-12 1:27 
AnswerRe: sign in Popup like codeproject.com Pin
Matt U.6-Nov-12 2:14
Matt U.6-Nov-12 2:14 
QuestionNeed help to upload 500 MB file on FTP Pin
silentspeaker6-Nov-12 0:39
silentspeaker6-Nov-12 0:39 
AnswerRe: Need help to upload 500 MB file on FTP Pin
Richard Deeming6-Nov-12 1:32
mveRichard Deeming6-Nov-12 1:32 
GeneralRe: Need help to upload 500 MB file on FTP Pin
silentspeaker6-Nov-12 3:31
silentspeaker6-Nov-12 3:31 
GeneralRe: Need help to upload 500 MB file on FTP Pin
Richard Deeming6-Nov-12 4:05
mveRichard Deeming6-Nov-12 4:05 
GeneralRe: Need help to upload 500 MB file on FTP Pin
silentspeaker6-Nov-12 4:38
silentspeaker6-Nov-12 4:38 
GeneralRe: Need help to upload 500 MB file on FTP Pin
Richard Deeming6-Nov-12 4:59
mveRichard Deeming6-Nov-12 4:59 
Something like this:

Private Function UploadToFTP(ByVal fileToUpload As HttpPostedFile) As Boolean
   Try
      Dim uploadUrl As String = "ftp://........................."
      Dim uploadFileName As String = fileToUpload.FileName
      
      Using streamObj As Stream = fileToUpload.InputStream
         Dim buffer As [Byte]() = New [Byte](fileToUpload.ContentLength - 1) {}
         streamObj.Read(buffer, 0, buffer.Length)
      End Using
      
      Dim ftpUrl As String = String.Format("{0}/{1}", uploadUrl, uploadFileName)
      Dim requestObj As FtpWebRequest = TryCast(FtpWebRequest.Create(ftpUrl), FtpWebRequest)
      requestObj.Method = WebRequestMethods.Ftp.UploadFile
      requestObj.Credentials = New NetworkCredential("UserID", "Password")
      
      Using requestStream As Stream = requestObj.GetRequestStream()
         requestStream.Write(buffer, 0, buffer.Length)
         requestStream.Flush()
      End Using
      
      Using responseObj As FtpWebResponse = TryCast(requestObj.GetResponse(), FtpWebResponse)
         ' TODO: Look at responseObj.StatusCode to see if the upload succeeded
      End Using
      
      Return True
      
   Catch ex As Exception
      Return False
   End Try
End Function




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


GeneralRe: Need help to upload 500 MB file on FTP Pin
silentspeaker6-Nov-12 5:05
silentspeaker6-Nov-12 5:05 
GeneralRe: Need help to upload 500 MB file on FTP Pin
Richard Deeming6-Nov-12 5:16
mveRichard Deeming6-Nov-12 5:16 
AnswerRe: Need help to upload 500 MB file on FTP Pin
jkirkerx7-Nov-12 13:45
professionaljkirkerx7-Nov-12 13:45 
AnswerRe: Need help to upload 500 MB file on FTP Pin
xut24477-Nov-12 14:37
xut24477-Nov-12 14:37 
QuestionHow to Get Local Area IP Address? Pin
Nandan Basak5-Nov-12 22:15
Nandan Basak5-Nov-12 22:15 
AnswerRe: How to Get Local Area IP Address? Pin
Bernhard Hiller6-Nov-12 21:11
Bernhard Hiller6-Nov-12 21:11 
GeneralRe: How to Get Local Area IP Address? Pin
Nandan Basak4-Dec-12 19:08
Nandan Basak4-Dec-12 19:08 
AnswerRe: How to Get Local Area IP Address? Pin
rameshkashanna7-Nov-12 2:05
rameshkashanna7-Nov-12 2:05 
GeneralRe: How to Get Local Area IP Address? Pin
Nandan Basak4-Feb-13 2:05
Nandan Basak4-Feb-13 2:05 
QuestionAn error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Pin
RKSPradeep4-Nov-12 20:11
RKSPradeep4-Nov-12 20:11 
JokeRe: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Pin
n.podbielski4-Nov-12 20:52
n.podbielski4-Nov-12 20:52 
AnswerRe: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Pin
ZurdoDev5-Nov-12 5:37
professionalZurdoDev5-Nov-12 5:37 
Questionvariable for aspx and all its ascx Pin
Jassim Rahma4-Nov-12 8:25
Jassim Rahma4-Nov-12 8:25 
AnswerRe: variable for aspx and all its ascx Pin
n.podbielski4-Nov-12 10:17
n.podbielski4-Nov-12 10:17 
GeneralRe: variable for aspx and all its ascx Pin
Amir Jalilifard5-Nov-12 8:15
professionalAmir Jalilifard5-Nov-12 8:15 
Questionhttpmodule, context.items.add("originalUrl") Pin
jkirkerx3-Nov-12 19:44
professionaljkirkerx3-Nov-12 19:44 
Questionhow to split a page using frameset Pin
fahad.11-Nov-12 2:02
fahad.11-Nov-12 2:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.