0

I've been attempting this for a week now, and it seems the more I ask online, the more confused I get, and the more the answers vary. Because of this, I'd like to ask just a simple question: How can an iPhone app that has an XML file saved in an instance of NSString send it from the iPhone to an FTP server? I mean, what APIs or tools can I use to do this?

Please suggest the simplest ones as I'm new to iPhone development. I would appreciate any guidance.

Kevin Yap
  • 670
  • 10
  • 22
banditKing
  • 9,405
  • 28
  • 100
  • 157

1 Answers1

1

I would first try using -[NSString writeToURL:atomically:encoding:error:] with an ftp: scheme URL.

If that failed, I would use CFFTPStream, which is expressly designed to work with FTP.

You might want to check out s7ftprequest or Apple's Simple FTP Sample project. Both were suggested by answers to "Upload File to FTP Server on iPhone".

Community
  • 1
  • 1
Jeremy W. Sherman
  • 35,901
  • 5
  • 77
  • 111
  • That wont work I have already tried it. See my code here from that try: http://stackoverflow.com/questions/6406350/sending-string-via-ftp-getting-error – banditKing Jun 21 '11 at 01:49
  • I suspected the `NSString` method might fail, which is why I supplied a fallback solution. `CFFTPStream` will most definitely work. `s7ftprequest` will be a ton easier to use, though. – Jeremy W. Sherman Jun 21 '11 at 01:51