Iphone 将.txt文件发送到ftp

Iphone 将.txt文件发送到ftp,iphone,xcode,ftp,Iphone,Xcode,Ftp,我已经设法(最终)向我的服务器发送了一些东西(图片)。这对我来说是一段痛苦的旅程 我使用了苹果的示例代码,并输入了我的服务器详细信息。我现在想再次这样做,但这次发送一个文本文件,其中包含在文本字段中输入的任何内容 有人能帮忙吗?这里有一个适用于iPhone的FTP库: 他们网页上的示例看起来很简单: S7FTPRequest *ftpRequest = [[S7FTPRequest alloc] initWithURL: [NSURL URLWithString:@"ftp://192.168

我已经设法(最终)向我的服务器发送了一些东西(图片)。这对我来说是一段痛苦的旅程

我使用了苹果的示例代码,并输入了我的服务器详细信息。我现在想再次这样做,但这次发送一个文本文件,其中包含在文本字段中输入的任何内容


有人能帮忙吗?

这里有一个适用于iPhone的FTP库:

他们网页上的示例看起来很简单:

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

以下是一个适用于iPhone的FTP库:

他们网页上的示例看起来很简单:

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

我不知道你是否有充分的理由使用ftp(因此,如果我居高临下,请告诉我闭嘴),但是。。。为什么不使用web服务方法呢?只是像其他HTTP数据上传一样发送POST数据?确保你已经通过FTP保护自己免受恶意攻击。我不知道你是否有充分的理由使用FTP(如果我居高临下,请告诉我闭嘴),但是。。。为什么不使用web服务方法呢?只是像其他HTTP数据上传一样发送POST数据?确保您已通过FTP保护自己免受恶意攻击。