[Mono-list] FtpWebRequest works targeting .net, fails in mono 2.10.9

MikeN mniemann at oowidgets.com
Tue Jul 30 13:31:59 UTC 2013

I have a simple FTP binary file upload, the code works fine in VS and Xamarin
Studio if I target .net, but fails when I target mono 2.10.9 (or 2.6.7).
[note: I have obscured the user credentials and IP address]

	FtpWebRequest request =
	//request.Proxy = null;
	request.Method = WebRequestMethods.Ftp.UploadFile;
	request.UseBinary = true;
	//request.UsePassive = true;
	//request.Timeout = -1;
	//request.KeepAlive = false;
	request.Credentials = new NetworkCredential("realuserid", "realpassword");
	// Copy the contents of the file to the request stream.
	byte[] fileContents = File.ReadAllBytes(@"c:\MikeN\test.zip");
	request.ContentLength = fileContents.Length;
	Stream requestStream = request.GetRequestStream();
	requestStream.Write(fileContents, 0, fileContents.Length);
	FtpWebResponse response = (FtpWebResponse)request.GetResponse();
	Console.WriteLine("Upload File Complete, status {0}",

Any guidance would be appreciated greatly.


View this message in context: http://mono.1490590.n4.nabble.com/FtpWebRequest-works-targeting-net-fails-in-mono-2-10-9-tp4660329.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list