从iphone应用程序删除ftp服务器上的文件 [英] delete file on ftp server from iphone app
问题描述
我无法弄清楚如何从正在创建的iPhone应用程序中删除一个ftp文件。
我可以建立一个连接,创建目录,上传文件,获取文件列表 - 但是我没有看到任何办法通过ftp删除文件(或空目录)。
有没有人有我的代码片段?我在苹果SimpleSampleFTP示例代码中找不到任何内容。
i can't figure out how to delete a ftp file from inside an iphone app i'm creating. i'm able to establish a connection, create directories, upload files, get a list of files - but i don't see any way to delete files (or empty directories) via ftp. Does anyone have a code snippet for me? i couldn't find anything about this in Apples SimpleSampleFTP example code.
到目前为止,我尝试使用
so far i tried using
Boolean CFURLDestroyResource(CFURLRef url, SInt32 *errorCode);
但它总是返回FALSE,并给出错误代码 -11 kCFURLUnknownSchemeError )。
FTP连接需要授权(用户名和密码),但是我不知道如何使用CFURLDestroyResource?
but it always returns FALSE and gives me error-code -11 (kCFURLUnknownSchemeError). The FTP connection needs authorization (username and password), but i don't know how to provide that when using CFURLDestroyResource?
推荐答案
url = (CFURLRef)[[NSURL alloc] initWithString:@"ftp://user:password@ftpServer.com/fileToRemove"];
这篇关于从iphone应用程序删除ftp服务器上的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!