Get file size on FTP download

拥有回忆 提交于 2019-12-02 02:48:19

I am pretty sure that when you set kCFStreamPropertyFTPFetchResourceInfo, that means your are only interested in the resources size in that particular request.

you should probably make a new controller that is a subclass of GetController, call it StatController... override _startReceive and the stream handler to your new methods.

use the StatController to get the resource size before you start the async download.

To get the file size you just need:

case NSStreamEventOpenCompleted: {
      fileSize = [[self.networkStream propertyForKey:(id)kCFStreamPropertyFTPResourceSize] integerValue];}

By the way do you know how to get the modification date of the file in the ftp server??

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!