Webclient File C# Example
I am trying to make a program that uploads/downloads.exe file to a FTP I tried using FtpWebRequest, but I only succeed to upload and download.txt files. Then i found here a solution for downloading using the WebClient: WebClient request = new WebClient; request.Credentials = new NetworkCredential('username', 'password'); byte fileData = request.DownloadData('ftp://myFTP.net/'); FileStream file = File.Create(destinatie); file.Write(fileData, 0, fileData.Length); file.Close; This solution works. But I seen that WebClient has a method DownloadFile which did not worked. I think because it doesn't work on FTP only on HTTP. Is my assumption true? If not how can I get it to work? And is there any other solution for uploading/downloading a.exe file to ftp using FtpWebRequest?
I'm using WebClient.DownloadFile to download a single file at a time from a web server, however, I want to know if by 'The thread is blocked' developers mean that the.
See More On MSDN
- Currently I have an application that receives an uploaded file from my web application. I now need to transfer that file to a file server which happens to be located.
- Download Files from Web [C#] This example shows how to download files from any website to local disk. The simply way how to download file is to use WebClient class.