I am a beginner to developing apps on the iPhone and I am trying to upload a NSString on to a FTP server Filezilla. The codes I used is below.
NSString *inputtext = @"Test";
NSURL *ftpserver=[NSURL URLWithString:@"ftp://username:password@domian/test.txt"];
[inputtext writeToURL:ftpserver atomically:NO encoding:NSUTF8StringEncoding error:nil];
I am wondering is this the correct syntax? I am unable to see the file in the server and I want to exclude programming error before I changed any setting on the server. Thanks in advance.
After a weekend of work, I found out that FTP transfer is not supported on writeToURL. The only way to do this is to open a ftp input and output stream using CFNetwork classes. The code is pretty long to do a simple thing like this so I won’t post it here unless anyone request for it below.