-(void) Assetpickercontroller: (Zyqassetpickercontroller *) Picker didfinishpickingassets: (Nsarray *) assets{ for(inti =0; i < Assets.count; i + +) {Alasset*asset =Assets[i]; Alassetrepresentation*rep =[Asset defaultrepresentation]; if([Rep. UTI Hassuffix:@"gif"]) {//the GIF is selected//file path for stitching gifNSString *document =[Nssearchpathfordirectoriesindomains (NSDocumentDirectory, Nsuserdomainmask, YES) lastobject]; NSString*filepath =[Document StringByAppendingPathComponent:rep.filename]; BOOL FileExist=[[Nsfilemanager Defaultmanager] fileexistsatpath:filepath]; if(!fileexist) {//the selected GIF is not yet written to the sandbox//writes the selected GIF to the sandboxByte *imagebuffer = (byte*) malloc (rep.size); Nsuinteger buffersize= [Rep getbytes:imagebuffer fromoffset:0.0Length:rep.size Error:nil]; NSData*imagedata =[NSData datawithbytesnocopy:imagebuffer length:buffersize Freewhendone:yes]; [ImageData Writetofile:filepath Atomically:yes]; } [_selectimages Addobject:filepath]; } }}
Then upload it based on the path to the GIF picture written to the sandbox
Select a GIF image from the system album to upload to the server