I'm trying to write a text file to a secure server .....
-(IBAction) startUpload{
NSLog(@"Start upload");
NSString *myString = @"TESTTEXT";
NSURL *myURL = [NSURL URLWithString:@"ftp://USERNAME:PASSWORD@72.167.1.1/testfile.plist"];
NSError *error;
BOOL ok = [myString writeToURL:myURL atomically:NO encoding:NSUTF8StringEncoding error:&error];
if (!ok) { // if NOT ok
NSLog(@"error writing to file at %@, %@, %@",myURL,[error localizedFailureReason],[error localizedDescription]);
}
}
... and all I get is this error message ....
error writing to file at ftp://USERNAME:PASSWORD@72.167.1.1/testfile.plist, (null), The operation couldn’t be completed. (Cocoa error 518.)
All help appreciated