内网上传大文件的解决方案

  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    })