![]() ![]() Download all files and sub-directories from FTP folder in VB.Read = sourceStream.Read(buffer, 0, buffer.Length) If you need to process the contents somehow, or if your need to monitor the progress, or both, you have to do it chunk by chunk (or maybe line by line, if it is a text file, that you are processing): Dim downloadRequest As FtpWebRequest =ĭim buffer As Byte() = New Byte(10240 - 1) Dim request As FtpWebRequest Nothing Dim response As FtpWebResponse Nothing request DirectCast (FtpWebRequest.Create ( New Uri (ftp)), FtpWebRequest) request.Method request.UseBinary True request.Credentials New NetworkCredential (username. TargetStream As Stream = uploadRequest.GetRequestStream() SourceStream As Stream = downloadResponse.GetResponseStream(), I searched all over the internet about my question but I found answer for C only, but none for VB.NET. Using downloadResponse As FtpWebResponse = downloadRequest.GetResponse(), UploadRequest.Credentials = New NetworkCredential("username2", "password2") If you want to just directly re-upload the file, simply pipe the download stream to the upload stream: Dim downloadRequest As FtpWebRequest =ĭownloadRequest.Method = ĭownloadRequest.Credentials = New NetworkCredential("username1", "password1") Here Mudassar Ahmed Khan has explained how to display List of files from FTP folder with Download option in ASP.Net using C and VB.Net. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |