嘿傢伙我的問題是標題。我曾經嘗試這樣做:壓縮一個目錄並上傳到FTP服務器,而無需在本地保存.zip文件在C#
public void UploadToFtp(List<strucProduktdaten> ProductData)
{
ProductData.ForEach(delegate(strucProduktdaten data)
{
ZipFile.CreateFromDirectory(data.Quellpfad, data.Zielpfad, CompressionLevel.Fastest, true);
});
}
static void Main(string[] args)
{
List<strucProduktdaten> ProductDataList = new List<strucProduktdaten>();
strucProduktdaten ProduktData = new strucProduktdaten();
ProduktData.Quellpfad = @"Path\to\zip";
ProduktData.Zielpfad = @"Link to the ftp"; // <- i know the link makes no sense without a connect to the ftp with uname and password
ProductDataList.Add(ProduktData);
ftpClient.UploadToFtp(ProductDataList);
}
錯誤:
System.NotSupportedException:"The Path format is not supported."
我不知道我應該如何在這種情況下,FTP服務器連接並荏苒RAM中的目錄,並直接發送到服務器。
...有人可以幫助或有鏈接到類似或平等的問題什麼解決?
看看這個:https://stackoverflow.com/q/17232414/616304 –
感謝,這將有助於我 – ARX