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

MikeN mniemann at oowidgets.com
Sun Aug 4 20:29:19 UTC 2013


Aaron,

Thank you for your interest. I get an immediate timeout at:

FtpWebResponse response = (FtpWebResponse)request.GetResponse();

I thought I mentioned that... sorry.

MikeN

On 8/2/2013 1:36 PM, Aaron [via Mono] wrote:
> When and in what way does it fail? Do you receive an exception?
>
> On Jul 30, 2013, at 6:31 AM, MikeN <[hidden email] 
> </user/SendEmail.jtp?type=node&node=4660379&i=0>> wrote:
>
> > 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 =
> > (FtpWebRequest)WebRequest.Create(@"ftp://xx.xx.xx.xx/Public/test.zip");
> > //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");
> > //sourceStream.Close();
> > request.ContentLength = fileContents.Length;
> > Stream requestStream = request.GetRequestStream();
> > requestStream.Write(fileContents, 0, fileContents.Length);
> > requestStream.Close();
> > FtpWebResponse response = (FtpWebResponse)request.GetResponse();
> > Console.WriteLine("Upload File Complete, status {0}",
> > response.StatusDescription);
> > response.Close();
> >
> > Any guidance would be appreciated greatly.
> >
> > MikeN
>
> _______________________________________________
> Mono-list maillist  - [hidden email] 
> </user/SendEmail.jtp?type=node&node=4660379&i=1>
> http://lists.ximian.com/mailman/listinfo/mono-list
>
>
> ------------------------------------------------------------------------
> If you reply to this email, your message will be added to the 
> discussion below:
> http://mono.1490590.n4.nabble.com/FtpWebRequest-works-targeting-net-fails-in-mono-2-10-9-tp4660329p4660379.html 
>
> To unsubscribe from FtpWebRequest works targeting .net, fails in mono 
> 2.10.9, click here 
> <http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=4660329&code=bW5pZW1hbm5Ab293aWRnZXRzLmNvbXw0NjYwMzI5fC0xNjQ3NzYzOTkx>.
> NAML 
> <http://mono.1490590.n4.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> 
>





--
View this message in context: http://mono.1490590.n4.nabble.com/FtpWebRequest-works-targeting-net-fails-in-mono-2-10-9-tp4660329p4660407.html
Sent from the Mono - General mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/mono-list/attachments/20130804/0f2f4da2/attachment.html>


More information about the Mono-list mailing list