2012-04-04 52 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