2012-04-04 23 views
0

我需要简单地上传一个字符串到我的FTP服务器作为TXT,我很好地搜索,没有任何工作。有没有简单地上传字符串到FTP服务器? 注意:我已经看过s7ftp的东西simpleftp和从苹果公司的FTP的东西无法得到任何工作。Iphone上传字符串到FTP服务器

谢谢先进。

回答

2

您可以创建一个服务器端脚本来解析POST/GET字符串吗?看起来像上传一个文件可能是很多繁重的工作/编码,你可以在3线服务器端进行。只是一个想法。

编辑此外

下面是一些简单的Objective-C,你可以闲逛用:

// Create the request. 
NSURLRequest *theRequest=[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.YOURDOMAIN.com/?string=YOURSTRINGORWHATEVER"] 
         cachePolicy:NSURLRequestUseProtocolCachePolicy 
        timeoutInterval:60.0]; 
// create the connection with the request 
// and start loading the data 
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:theRequest delegate:self]; 
if (theConnection) { 
    // Create the NSMutableData to hold the received data. 
    // receivedData is an instance variable declared elsewhere. 
    receivedData = [[NSMutableData data] retain]; 
} else { 
    // Inform the user that the connection failed. 
} 

Click here for more info on URL Loading

如果您不能使用ARC或有与它的烦恼,试试这个课程。非常方便:

SMWebRequest Class on GitHub

希望这有助于。

+0

这正是我要做的。使用[$ _GET](http://php.net/manual/en/reserved.variables.get.php)变量在PHP中执行操作非常简单。 – 2012-04-04 23:57:03

+0

我甚至不能发送字符串。 – M0NKEYRASH 2012-04-05 01:28:48

+0

好吧,我可以做一个服务器端代码,但我不能发送任何东西到服务器。有任何想法吗??? – M0NKEYRASH 2012-04-05 22:32:51