Is it possible to retain an uploaded file after it has been uploaded?
I’m building a email composer application. Users can upload files as attachments. At times out of 10 uploaded files one of them isn’t uploaded correctly, or the submitted form is invalid. Then the compose page would be displayed again. However, the user would need to upload the file again this time. Is it possible to somehow maintain the uploaded files somewhere on the first upload, and if the form is invalid, then display links to the file uploaded or so?
Yes, just copy the files to an temporary folder and display the files as list which have been successfully uploaded. Then store the filenames inside hidden input fields (for example) and when the user submits the form again, you will be able to upload the new files and also retrieve the files that were uploaded previously.
Some pseudoish code: