- Home /
Question by
ProgNightfury · Jul 07, 2014 at 09:20 AM ·
ftpwebclient
Ftp Uploading using System.net.webclient
public void UploadFile(string FilePath, string Address)
{
using (System.Net.WebClient client = new System.Net.WebClient())
{
Uri Check = new Uri(Address + new FileInfo(FilePath).Name);
client.UploadFileCompleted += new System.Net.UploadFileCompletedEventHandler(client_UploadFileCompleted);
client.UploadProgressChanged += new System.Net.UploadProgressChangedEventHandler(client_UploadProgressChanged);
client.Credentials = new System.Net.NetworkCredential("your ftp id", "your ftp password");
//client.UploadFile(Address + new FileInfo(FilePath).Name, "STOR", FilePath);
client.UploadFileAsync(Check, "STOR", FilePath);
}
}
Above is the method I am using to upload images to my ftp server, when i use this code in a console project in c# everything works perfectly fine but when I am trying to use this code in unity4.2.2 file do gets uploaded but it cant be opened it gets corrupted or something file size for uploaded file and local file are same, can anyone please help me with this issue thank you
Comment
Having the exact same problem, did you manage to find a solution? Unity 5.6.0
Your answer
Follow this Question
Related Questions
Append text file online 2 Answers
Unity Android accessing Windows Shared Files/Folder 0 Answers
How to write/read .txt on FTP (Javascript) 3 Answers
How can i upload and download data from FTP? 0 Answers
Using AssetBundles throughout project 0 Answers