- (NSURLRequest *)connection:(NSURLConnection *)connection willSendRequest:(NSURLRequest *)request redirectResp*****e:(NSURLResp*****e *)resp*****e;
连接成功后会调用这个方法。在这里面可以获取文件总长度。

- (void)connection:(NSURLConnection *)connection didSendBodyData:(NSInteger)bytesWritten totalBytesWritten:(NSInteger)totalBytesWritten totalBytesExpectedToWrite:(NSInteger)totalBytesExpectedToWrite NS_AVAILABLE(10_6, 3_0);
用这个方法获取总数据和发送数据长度

 

第一个函数获得文件的总长度,是什么文件的总长度?我感觉只要下面一个函数总的两个数据应该就可以了吧,一个是要发送数据的总长度,一个是发送出去的数据的长度,然后除一下,不知道我的理解对不对?

 

恩`是第二个函数就可以了。第一个主要处理相关头信息

相关文章:

  • 2021-10-09
  • 2018-08-15
  • 2022-12-23
  • 2021-07-13
  • 2021-09-11
  • 2022-12-23
猜你喜欢
  • 2021-04-30
  • 2021-06-20
  • 2021-07-08
  • 2022-12-23
  • 2022-12-23
  • 2021-07-24
  • 2021-08-05
相关资源
相似解决方案