I need to save the uploaded file even if the connection fails at some point (if it fails, then save as much as was uploaded).
Is there a way in PHP to get to that part of a file, that was uploaded before (e.g.) the connection to the server has failed?
(when there is an UPLOAD_ERR_PARTIAL error in $_FILES['file']['error']
)
As already suggested in the comments, it's is not worth wasting your time trying to do some magic with PHP.
HTML5 already supports chucked file uploads, it would be a much better approach to use some sort of JavaScript library or something else that relies on this technology. I can recommend FlowJS (the demo speaks for itself), but if you don't like it - I am pretty sure there are plenty more around the web with the same functionality.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With