网页文件断点上传
1、首先获取文件(音视频、图片)
void *)picker didFinishPickingMediaWithInfo:( UIImagePickerControllerMediaType = "public.movie";
}
assetsLibraryresultBlock如果是相机拍摄的,注意两个保存方法:图片保存到相册:valueForKey)nil视频保存到相册:
@interface CNFile : @property,NSString@property,NSString文件在nonatomic)//@property,NSInteger文件大小
NSInteger总片数
(copy* fileInfo;
(strong* fileImage;nonatomic) NSMutableArray* fileArr;这样我们就可以对每一个CNFile对象进行操作了。
-(NSInteger*)file{
offset =1024 fileSize==int/1024)(file.1024) + (@"chunks = %ld",( *readHandle = [filePath [readHandle :offset];
)ifHaveData:(NSInteger*)file)
)uploadData:(NSInteger*)file;
置[file.@“finish"都已经置for j =1[j]@"finish" [me filePath [me 3)如果没有都finish,那么看本地下一chunk对用的flag是否是wait
NSLog片的状态(1 {
NSString ([flag@"wait" [me fileName:file];
break }
if)
saveProgressWithChunk:chunk file:file];
return }
dispatch_async(dispatch_queue_t queue, ^{
readDataWithChunk })
详细参考这篇文章:http://blog.ncmem.com/wordpress/2019/08/12/%e5%a4%a7%e6%96%87%e4%bb%b6%e6%96%ad%e7%82%b9%e7%bb%ad%e4%bc%a0-2/