0 votes
by (120 points)
edited by

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.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
by (70.3k 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/");