views:

178

answers:

2

Hi, I am a beginner. I tried to use some synchronous FTP downloading (in order to create a file on the iphone from a file on the ftp server) in an application but I am not able to do it. I read the doc (and CFTPSample) and I managed to use asynchronous download but not synchronous. Can anyone help me?

Cheers

A: 

Use NSData class:

NSString *myFile = @"ftp://domain.com/file.txt";
NSURL *url = [NSURL URLWithString:myFile];
NSData *mydata = [NSData dataWithContentsOfURL:url];
Pablo Santa Cruz
A: 

Thanks for your answers.

Samir