How to upload FILE via FTP ?
31/08/04 09:29
Is there a Cocoa API to upload file to a web site ?
The following methods are available from a Cocoa application to handle ftp communication: 1. You can link to libcurl (man libcurl) or other ftp client libraries 2. You can use expect (see our example | here) with your favorite command line tool (ftp, sftp, curl, etc.)
Authored by: Eric Brunstad on Tuesday, March 08 2005 @ 01:29 AM GMT
Though all of the techniques posted above do work to some extent, I have found a much easier and more reliable way to add FTP to Cocoa programs. This is to create a NSTask wrapping the Unix command FTP. It will allow you to execute any FTP commands, such as uploading and downloading files.
I have provided a sample application named Workbench on my site, which demonstrates the use of NSTasks. It is a fully featured app which allows teachers to post homework on a server so students can see it. If you have any questions about NSTasks or FTP, feel free to email me at ericbrunstad@excite.com. I know how intimidating NSTasks can be!