Dim sourcefilepath As String = AttachUpload.FileName Dim ftpurl As [String] = "ftp://buson.in/" Dim ftpusername As [String] = "busonsupport" Dim ftppassword As [String] = "busonsupport" Dim filename As String = Path.GetFileName(AttachUpload.FileName) Dim ftpfullpath As String = ftpurl Dim ftp As FtpWebRequest = DirectCast(FtpWebRequest.Create(ftpfullpath), FtpWebRequest) ftp.Credentials = New NetworkCredential(ftpusername, ftppassword) ftp.KeepAlive = True ftp.UseBinary = True ftp.Method = WebRequestMethods.Ftp.UploadFile Dim fs As Stream = AttachUpload.PostedFile.InputStream Dim buffer As Byte() = New Byte(fs.Length - 1) {} fs.Read(buffer, 0, buffer.Length) fs.Close() Dim ftpstream As Stream = ftp.GetRequestStream()'Hear Only i got error ftpstream.Write(buffer, 0, buffer.Length) ftpstream.Close()
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)