I have a form in which user can attach files and fill the details in the form and submit. He can attach any number of files and can delete the attached files. Once he attaches files, it will be displayed and he will fill the rest of the form and submits. The problem is i dont know how to handle this scenario. I came up with two ideas. 1. On attaching the file store it temp. in a table in database. Once the user fills the rest of the form and submit save it to the main table. The problem in this apporach if he going to cancel the form then i wnt to delete the attached files, it can be done if he clicks on the cancel button. But he closes browser clicks on some other thing in the menu i could not handle. 2. Display only the file name and on submit based on the path get the data, but in this case how to handle this because on submission of the form only the path goes to the server and u cant retreive it.
Anybody could suggest a better idea for solving this i could be great help for me.
Joined: Oct 29, 2003
As far as the user canceling. Assign each user a unique id into session, use this to track 'temporary' files. Create session listener that deletes all temporary files of the unique id when session is destroyed.