发送.txt文件到ftp [英] sending .txt file to ftp

查看:125
本文介绍了发送.txt文件到ftp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经管理(最终)将某些内容(图片)发送到我的服务器。这对我来说是一个痛苦的旅程。



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



任何人都可以帮忙吗?

解决方案

下面是一个适用于iPhone的FTP库: b
$ b

http://code.google.com/p/s7ftprequest/



  S7FTPRequest * ftpRequest = [[S7FTPRequest alloc] initWithURL:
[NSURL URLWithString:@ftp://192.168.1.101/]
toUploadFile:[[NSBundle mainBundle] pathForResource:@InfoofType:@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];


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

这篇关于发送.txt文件到ftp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆