IOS文件上载遇到流错误
我使用Parse作为后端,创建了一个用于上传图像的IOS应用程序 使用WIFI网络上传时没有问题,但使用4g/3g网络时遇到文件上传错误IOS文件上载遇到流错误,ios,file-upload,parse-platform,Ios,File Upload,Parse Platform,我使用Parse作为后端,创建了一个用于上传图像的IOS应用程序 使用WIFI网络上传时没有问题,但使用4g/3g网络时遇到文件上传错误 Encountered stream error: Error Domain=NSPOSIXErrorDomain Code=54 "The operation couldn’t be completed. Connection reset by peer" 虽然我捕捉到了代码中的错误,但警报视图没有显示,它只在日志中显示“上传失败” PFFile
Encountered stream error: Error Domain=NSPOSIXErrorDomain Code=54 "The operation couldn’t be completed. Connection reset by peer"
虽然我捕捉到了代码中的错误,但警报视图没有显示,它只在日志中显示“上传失败”
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 your item again." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[alertView show];
}
后端中的数据如下所示:
如您所见,成功上载的文件名为image.jpg,不成功上载的文件名为unknow string。这可能是您的网络问题,您能否确保网络速度正常?无论您使用什么类型的网络,都不应该有任何问题,除非网络速度慢并且会导致功能超时 在使用上传功能之前,我可以看看您为处理文件而编写的代码吗