tags:

views:

128

answers:

2

I need to write a program in F# that should push files to an FTP server. Is there a library than I can use? I haven’t been able to find anything on the web. Can someone point me in t the right direction? If possible some sample code would be very helpful

Thanks, Sudaly

+8  A: 

System.Net.WebRequest.Create works well, when you give it a ftp:// URL.

To get access to FTP-specific functionality (such as uploading files), cast your WebRequest object to FtpWebRequest.

Tim Robinson
Thanks for your reply Tim. whne i tried to case the WebRequest to FtpWebRequest i am getting the following error "The value or constructor 'FtpWebRequest' is not defined"this is now i am trying to do the casting:let reqFTP: FtpWebRequest = (FtpWebRequest) (WebRequest.Create(uri))Any thoughts?
sudaly
That's C# syntax, not F#. In F# you want: `let reqFTP: FtpWebRequest = WebRequest.Create(uri) :?> FtpWebRequest`
Tim Robinson
Hi Tim, thank you so much for your quick reply
sudaly
+4  A: 

FtpWebRequest should do the thing.

desco