I'm submitting video from my iOS app to my server, and receiving a PHP error code 3 - 'The uploaded file was only partially uploaded.'. However, this is only occurring some times and I haven't found a pattern with it yet. I'm using ASIFormDataRequest to send the files.
ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:urlUpload];
request.shouldContinueWhenAppEntersBackground = YES;
[request setFile:@"filename"
withExtension:@".mov"]
withFileName:@"filename.mov"
andContentType:@"video/quicktime"
forKey:@"Filedata"];
request setDelegate:self;
[request setUploadProgressDelegate:self;
[request setShowAccurateProgress:YES];
[request startAsynchronous];
With urlUpload being defined earlier in the process.
My php script looks like:
if (isset($_FILES['Filedata'])) {
if ($_FILES['Filedata']['error']) {
echo "File Error";
} else {
//Handle the upload file
}
} else {
echo "No File";
}
The error associated with $_FILES['Filedata']['error'] is 3, which PHP states is a partially uploaded file, and $_FILES['Filedata']['size'] is 0.
Any thoughts as to what might be going on? Or better yet, a solution that ensures we get the complete file?