Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
Hi,

There's a few Cocoa applications (using Objective-c) that I want to create that all require some FTP, SFTP interaction for uploading and downloading files.

How do people recommend going about this ?

Is there a C Library that does it, or is i built in to Cocoa somewhere?
 

Cromulent

macrumors 604
Oct 2, 2006
6,817
1,102
The Land of Hope and Glory
Basically you need to understand the protocol by reading the RFC document http://www.faqs.org/rfcs/rfc959.html and then you should be able to implement a client fairly easily using BSD sockets. Although Cocoa does have a higher level interface for networking BSD sockets will provide the greatest cross platform compatibility if you ever port to other OS's.
 

yeroen

macrumors 6502a
Mar 8, 2007
944
2
Cambridge, MA
I don't know about Cocoa, but libcurl, bundled in /usr/lib as part of OS X, gives you a C-API for doing ftp, sftp, http, and other things.

For more detail, you can read up on it here: http://curl.haxx.se/libcurl/

(There's even a libcurl-tutorial manpage).

There are also other open-source UNIX libraries, available from Mac Ports or Fink, for doing the job but I'd recommend curl.
 

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
Thanks everyone,

I think as my applications won't be just a FTP app, il use the connection kit, and if I have time il do my own FTP classes at a latter date.

Hate to sound like a subversion newbie (which I am) how do I just download the whole source ?
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
Hate to sound like a subversion newbie (which I am) how do I just download the whole source ?

svn co <server_name>

I'd stick with the C stuff as I believe that Cocoa doesn't have good web support. I'd expect it to be improved for 10.6.
 

Cromulent

macrumors 604
Oct 2, 2006
6,817
1,102
The Land of Hope and Glory
Hate to sound like a subversion newbie (which I am) how do I just download the whole source ?

You can setup Xcode 3.1 to download the entire project from the repository. Just enter the settings then checkout the project to some folder on your drive.

It isn't too bad writing your own protocol implementation. I've been trying to do it with an NNTP reader for a while. It's my learning C project and it is going well.

The hardest thing I found was making sure you sent the commands in the right order, some of the RFC documents are not very clear.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
svn co <server_name>

I'd stick with the C stuff as I believe that Cocoa doesn't have good web support. I'd expect it to be improved for 10.6.

I've used the FTP stuff from ConnectionKit before ConnectionKit existed. It's just a Cocoa-ised wrapper around lot's of C calls. I'd use it. It's know to work and easy to use...
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
^^ Interesting, I'd heard that the web Services stuff was a bit ***** in Cocoa. I assumed this would be the same. Of course that is a third party framework not an Apple native one.
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
FTP is not a web service.
SFTP is not a web service...

The built in SOAP/XML stuff is weak but it has nothing to do with transferring files.
 

Eraserhead

macrumors G4
Nov 3, 2005
10,434
12,250
UK
As Core Data can't be used over the web I assumed most remote stuff was weak in Cocoa, clearly I'm wrong :eek:.
 

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
You can setup Xcode 3.1 to download the entire project from the repository. Just enter the settings then checkout the project to some folder on your drive.

It isn't too bad writing your own protocol implementation. I've been trying to do it with an NNTP reader for a while. It's my learning C project and it is going well.

The hardest thing I found was making sure you sent the commands in the right order, some of the RFC documents are not very clear.

Hi all,

I can't build and run the ConnectionKit project as it does not create an executable.

Any ideas what I am doing wrong ?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Hi all,

I can't build and run the ConnectionKit project as it does not create an executable.

Any ideas what I am doing wrong ?

It's a framework so isn't meant to create an executable. It should build a framework you can include in your own app.

If you are trying to build the included sample app you probably have to change the target.
 

Nutter

macrumors 6502
Mar 31, 2005
432
0
London, England
As Core Data can't be used over the web I assumed most remote stuff was weak in Cocoa, clearly I'm wrong :eek:.

This is like saying that most remote stuff is weak in Carbon, and therefore libcurl, which is also written in C, must be weak too.

ConnectionKit is just a third-party framework. The fact that it's written in Objective-C, like Cocoa and the WebServicesCore framework, does not have any bearing on its ability to do the job.
 

MacDonaldsd

macrumors 65816
Original poster
Sep 8, 2005
1,005
0
London , UK
It's a framework so isn't meant to create an executable. It should build a framework you can include in your own app.

If you are trying to build the included sample app you probably have to change the target.

OK, yeah it does build the framework fine.

There is only 1 xcode project file, so how do I modify it to build the sample application ?

Sorry im just a bit confused about it :eek:
 

KartikGanesan

macrumors newbie
Apr 29, 2008
2
0
Hi,

Congrats to Greg and Team for implementing ConnectionKit.

Integrating FTP was simple as the sample application was helpful.

Has anyone integrated HTTP into their application yet?

Do tell me how to achieve that

Thanks

KG
 

dampi

macrumors newbie
Feb 3, 2009
2
0
Hi!

Could you upload some example code of yours? I do not know how to make it working. And what sample application do you mean?

Thanks!
Dampi
 

machros

macrumors newbie
Mar 24, 2009
1
0
Cocoa FTP

Hi


I want to create my own FTP .. i am new to cocoa... Please anyone suggest me which is the best way for creating FTP....using connectionkit or core foundation network.. thank you in advance..
 

urskaush

macrumors newbie
Mar 24, 2009
2
0
Cocoa FTP

Hi
Thank you.. Ya that is true ... But is there any documentation for connection kit framework?.. And how abt the support for multiple downloads...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.