I have managed (finally) to send something (a picture) to my server. This has been a painful journey for me.
I used the Apple sample code for SimpleFTPSample and put开发者_高级运维 in my server details. I now want to do this again, but this time send a text file with the contents of whatever in entered into a textField.
Can anyone help?
Here's a FTP library that works on iPhone:
http://code.google.com/p/s7ftprequest/
The example on their web page looks straightforward:
S7FTPRequest *ftpRequest = [[S7FTPRequest alloc] initWithURL:
[NSURL URLWithString:@"ftp://192.168.1.101/"]
toUploadFile:[[NSBundle mainBundle] pathForResource:@"Info" ofType:@"plist"]];
ftpRequest.username = @"testuser";
ftpRequest.password = @"testuser";
ftpRequest.delegate = self;
ftpRequest.didFinishSelector = @selector(uploadFinished:);
ftpRequest.didFailSelector = @selector(uploadFailed:);
ftpRequest.willStartSelector = @selector(uploadWillStart:);
ftpRequest.didChangeStatusSelector = @selector(requestStatusChanged:);
ftpRequest.bytesWrittenSelector = @selector(uploadBytesWritten:);
[ftpRequest startRequest];
精彩评论