0

I want to upload an NSString to a text file (.txt) on an ftp server. I use the following code:

- (IBAction)Blau:(id)sender {

    BlauS = @"1";
    NSURL *BlauURL= [NSURL URLWithString:@"ftp://username:password@myftpserverurl/blau.txt"];
    NSError *error;
    BOOL proof=[BlauS writeToURL:BlauURL atomically:NO encoding:NSUTF8StringEncoding error:&Error];
    if (!proof) {
        NSLog(@"Error!: %@", [error localizedFailureReason]);
    }
}

My log shows me the following error:

The specified URL type isn’t supported.

What's wrong? How can I fix this problem?

Brian
  • 14,610
  • 7
  • 35
  • 43
David
  • 1
  • 1
  • 3
    The problem is that the specified url type isn't supported. This may help. http://stackoverflow.com/questions/14483577/upload-things-to-a-ftp-in-objective-c-ios https://developer.apple.com/library/ios/documentation/Networking/Conceptual/CFNetwork/CFFTPTasks/CFFTPTasks.html – maelswarm Aug 22 '16 at 20:58
  • If I use the same Link to read the Text file it works perfect. – David Aug 22 '16 at 21:52

0 Answers0