views:

49

answers:

3

Hi
I would like to retrieve documents from an ftp in my Windows phone 7 application (built with XNA in my case).
As far as I understand WP7 does not support ftp due to port and protocol(?) contraints. Is there any way to get ftp support working?
I guess I will be able to implement it my self once socket support is added but I dopn't wan't to wait for that.

Cheers
/Jimmy

A: 

Do you want to retrieve files fromn the phone, and over the cellular network? If so you need to confirm your operator allows ftp connections to your phone, which they probably do not.

If you're connecting over wifi, you've got more chance of this working.

Otherwise, you could implement a dropbox-style approach where the phone and your file-retrieving application both connect to a remote server

Paul
I want to download files to the phone via ftp. I see no problem if I need to connect thru wifi.
Jimmy Engtröm
For cellular, you probably can't make the connection to the phone to do that . Have the phone connect out to an ftp server instead. For Wifi, set up some trivial program to listen on port 21 and see if you can connect to it?
Paul
Thats what I mean :P I want to launch my app, and retrive files from an ftp. I don't needd to upload anything only retrieve from the ftp.
Jimmy Engtröm
Ah, OK, if it's outgoing connections then all you need are sockets + one of the myriad open source ftp client implementations to use as a start...
Paul
But if I'm not misstaken Sockets are not supported in the current version of Windows Phone 7?
Jimmy Engtröm
Then you're stuffed! Ftp inherently requires opening a socket to the server...
Paul
Does the browser on the device do ftp? You could possibly programmatically request that to download the file for you...
Paul
Interesting suggestion, I don't have the phone near by, have to get back to you on that one.
Jimmy Engtröm
+2  A: 

FTP and Sockets are not supported by the platform at the moment.

If you want to get remote files on to your phone you'll have to use HTTP(S).
You can do this either with the HttpWebRequest or WebClient classes depending on your specific needs.

Matt Lacey
+1  A: 

Since there are no supported socket capabilities in the initial release of WinPhone , you cannot directly FTP. You would have to create an "FTP Proxy" web service which your phone would call and have the service do the actual FTP and relay the files.

ctacke