Dear all,
I’ve been struggling to get the following FTP upload working [EDIT: in Editor script]. I’m receiving “System.Net.WebException: Server returned an error: Invalid response from server” error. Using Unity 2017.1.0b8. Do you see any apparent problem in the code bellow, please?
[EDIT: Or should I ask: “Is this piece of code working for you?”]
var localFile = @"C:\Users\user\Downloads\test.txt";
var remoteFile = "test.txt";
WebClient client = new System.Net.WebClient();
client.Credentials = new System.Net.NetworkCredential("username", "password");
try
{
client.UploadFile(new Uri("ftp://address/" + remoteFile), null,
localFile);
}
catch (Exception ex)
{
Debug.LogError(ex.ToString());
}