It's surprisingly hard to find a definitive answer to this, I'm 95% sure what I'm trying to achieve is impossible, but here goes:
Front:
I have a multipart/form-data
upload form. A user selects a file, but has to be logged in before he can post the form. The user can log in via Twitter. If he does so after selecting a file, due to the redirect to/from Twitter, the file input will be empty.
Back:
I have a PHP script using the $_FILES
array to move the uploaded file to its final destination. (A solution to my problem would be to save the file to a temporary folder before redirecting to Twitter, but I currently can't set that up).
Problem:
I can store the selected file in localStorage using the FileSystem API (at least in modern browsers). But I obviously can't put that back in the input element. Now I'm at a loss: is there any way to get that file from my localStorage into the PHP $_FILES array?