问题
I'm having trouble working out why some uploads to our server from iOS result in empty files. The upload page is a simple form using POST and enctype as multipart/form-data.
The problem only seems to arise when the user:
- Is using iOS
- Attempts to upload a file from a cloud service (currently iCloud or Dropbox) even if the file is the version on their local system
- Leaves a period of time between selecting the file (via a
<input type=file>
button) and initiating the upload, roughly about 30sec to 1min.
I'm not sure if there is a timeout issue with the connection to the file, and if so, whether this is a bug or a security feature. If the user selects their file and initiates the upload within this time, the file uploads successfully.
Uploads from the 'true' local system (eg. outside any cloud folders) upload fine, even after any delay. The file size and file type seem to be irrelevant.
I'm aware Dropbox have a 'Chooser' system, which forwards a link instead of the file, however in testing, a Dropbox file will still upload successfully provided the user does so within a short time.
The form that handles the upload is rather large with many options, so typically a user will spend some time between selecting the file and initiating the upload.
The problem does not occur on Android or OSX desktop platforms.
I have also tested using an independent online uploader, namely http://checkfiletype.com/ and performed the same test, and the same thing happens:
result after pressing 'upload' straight away, and result after short a delay and then pressing 'upload'.
I'm not sure where to go from here, most Googling only turns up results about uploading TO cloud platforms, instead of from them. Am I missing something?
来源:https://stackoverflow.com/questions/55011849/0-bytes-uploaded-of-file-stored-on-cloud-service-via-input-type-file-on-ios