[mono-android] FTP Upload

Miljenko Cvjetko mcvjetko at holisticware.net
Thu Feb 23 19:50:52 UTC 2012


Hi

I don't see credentials... Are You sure?

request.Credentials = new NetworkCredential 
("anonymous","user at host.domain");

regards

mel
On 2012.02.23 14:23, Natanael wrote:
> I am with the following error in the command
>
> request.GetRequestStream Stream stream = () // ERROR: Not Connected
>
>
> , the routine below, can someone help me.
>
>
> Uri uri = new Uri(ftpHost + "/" + remoteFilePath);
> FtpWebRequest request = (FtpWebRequest)FtpWebRequest.CreateDefault( uri );
> request.KeepAlive = false;
> request.Method = WebRequestMethods.Ftp.UploadFile;
> request.UsePassive = false;
> request.UseBinary = true;
>
> Stream stream = request.GetRequestStream(); // ERROR: Not Connected
>
> FileStream fileStream = File.OpenRead(localFilePath);
> int Length = 2048; byte[] buffer = new byte[Length];
> int bytesToSend = fileStream.Read(buffer, 0, Length);
>
>      while (bytesToSend>  0)
>      {
>          stream.Write(buffer, 0, bytesToSend);
>          bytesToSend = fileStream.Read(buffer, 0, Length);
>      }
>
> stream.Close();
>
>
> --
> View this message in context: http://mono-for-android.1047100.n5.nabble.com/FTP-Upload-tp5507988p5507988.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid at lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid


-- 
Miljenko Cvjetko dipl.ing. ET
	Direktor/CEO
	Projektant rješenja/Solution Architect	
	Razvojni programer/Senior developer
	Voditelj projekta/Project Manager

IX južna obala 13
Kajzerica Zagreb
T: 385 1 7775555
M: 385 91 557 447 3
F: 385 1 7779556
e: mcvjetko at holisticware.net
w: http://www.holisticware.net



More information about the Monodroid mailing list