开发者

sending .txt file to ftp

开发者 https://www.devze.com 2023-02-17 10:28 出处:网络
I have managed (finally) to send something (a picture) to my server. This has been a painful journey for me.

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];
0

精彩评论

暂无评论...
验证码 换一张
取 消