我正在使用 BlackRaccoon 在服务器内上传文件。在上传之前,我想了解是否可以检查我上传的文件是否存在。
可以吗?
您也许可以使用列表目录功能
listDir = [[BRRequestListDirectory alloc] initWithDelegate: self];
listDir.path = @"/home/user/newdirectory/";
listDir.hostname = @"192.168.1.100";
listDir.username = @"yourusername";
listDir.password = @"yourpassword";
[listDir start];
然后在收到的列表中有一个
- (BOOL)fileExists:(NSString *)fileNamePath;
选项。
传递文件名来检查您的文件是否已存在于目录中。