简体   繁体   English

从iPhone应用程序删除ftp服务器上的文件

[英]delete file on ftp server from iphone app

i can't figure out how to delete a ftp file from inside an iphone app i'm creating. 我不知道如何从正在创建的iPhone应用程序内部删除ftp文件。 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. 我能够建立连接,创建目录,上传文件,获取文件列表-但我看不到通过ftp删除文件(或空目录)的任何方法。 Does anyone have a code snippet for me? 有人为我提供代码段吗? i couldn't find anything about this in Apples SimpleSampleFTP example code. 我在Apples SimpleSampleFTP示例代码中找不到有关此的任何内容。

so far i tried using 到目前为止,我尝试使用

Boolean CFURLDestroyResource(CFURLRef url, SInt32 *errorCode);

but it always returns FALSE and gives me error-code -11 ( kCFURLUnknownSchemeError ). 但是它总是返回FALSE并给我错误代码-11kCFURLUnknownSchemeError )。 The FTP connection needs authorization (username and password), but i don't know how to provide that when using CFURLDestroyResource? FTP连接需要授权(用户名和密码),但我不知道在使用CFURLDestroyResource时如何提供该授权?

url = (CFURLRef)[[NSURL alloc] initWithString:@"ftp://user:password@ftpServer.com/fileToRemove"];

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM