i Can't Upload an Image file to the FTP server In Xamarin.UWP,Is it is possible?

0 votes
asked Sep 6, 2017 by MJD93 (120 points)
edited Sep 6, 2017 by Lukas Matyska

I can't upload the Image file to an FTP server in Xamarin.UWP, is it is possible using REBEX?,Please help me..

i use the following code:

string ftpHost = "xxxxxxxxxx.com";
string ftpUser = "xxxxxxxxxxxxxx";
string ftpPassword = "xxxxxxxxxxxx";

Rebex.Net.Ftp client = new Rebex.Net.Ftp();
Rebex.Licensing.Key="Trial key here";

client.Connect(ftpHost);

client.Login(ftpUser, ftpPassword);

var c = client.IsConnected; 
System.Diagnostics.Debug.WriteLine(c); // it returns true:

But i Upload an Image file using this it got an error :Access Denied

client.PutFile(photo.AlbumPath, @"/home/esggrouponline/public_html/uploads/linesimg/");

but got an Exception Access Denied how can i Solved this , Please give me a solution for this::::

1 Answer

0 votes
answered Sep 6, 2017 by Lukas Matyska (43,090 points)

The PutFile method is designed to upload single file, but it seems that you are trying to upload whole directory.

Use the Upload method instead:

client.Upload(photo.AlbumPath, @"/home/esggrouponline/public_html/uploads/linesimg/");
...