[英]ftp upload error : “The given path's format is not supported."
我可以從FTP下載文件而沒有任何問題,但是不能將文件從本地上傳到FTP。 我已將其更改為地址路徑上的斜杠和正斜杠,但仍然有相同的錯誤。
string _ftpURL = @"192.168.0.134";
string _UserName = "root"; //User Name of the SFTP server
string _Password = "porter"; //Password of the SFTP server
int _Port = 2222; //Port No of the SFTP server (if any)
string _ftpDirectory = "/home/root/systools/WM"; //The directory in SFTP server where the files will be uploaded
string LocalDirectory = " E:\\charan\\final test\\WebMobility.db"; //Local directory from where the files will be uploaded
Sftp Connection = new Sftp(_ftpURL, _UserName, _Password);
Connection.Connect(_Port);
**Connection.Put(LocalDirectory, _ftpDirectory);**
Connection.Close();
我相信您的本地目錄變量中還有一個空格:
string LocalDirectory = " E:\\charan\\final test\\WebMobility.db";
更改為
string LocalDirectory = "E:\\charan\\final test\\WebMobility.db";
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.