IOS file upload encountering stream error -
i use parse backend , create ios app uploading images.
when upload using wifi network there no problem, encountering file upload error when using 4g/3g network.
encountered stream error: error domain=nsposixerrordomain code=54 "the operation couldn’t completed. connection reset peer"
although catch error in code alert view didn't show up, shows "upload fail" in log.
pffile *file = [pffile filewithname:filename data:filedata]; [file saveinbackgroundwithblock:^(bool succeeded, nserror *error) { if (error) { uialertview *alertview = [[uialertview alloc]initwithtitle:@"an error occured!" message:@"please try submiting item again." delegate:self cancelbuttontitle:@"ok" otherbuttontitles:nil, nil]; [alertview show]; }
the data in backend looks this:
as can see, successful upload file name image.jpg, unsuccessful ones, shows unknow string.
it network problem, can please ensure speed network fine? there shouldn't problem regardless kind of network use unless slow , causes timeout function.
before upload function, can see code written process file?
Comments
Post a Comment