I\'m trying to upload a file with ftp in C#. for the moment, i try to do it locally:
static void Main(string[] args)
{
UploadFileToFtp(\"C:\\\\Utilisateurs\\
I think you are missing protocol: should be ftp://127.0.0.1/
instead of 127.0.0.1/
. What's more, I suggest you to encode part of url that is stored in filePath
. f.e:
var encoded = HttpUtility.UrlEncode(filePath);
var request = (FtpWebRequest)WebRequest.Create("ftp://127.0.0.1/" + encoded)
You need to reference System.Web assembly to use UrlEncode
. More here.