This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Deferred file upload

Sep 29th, 2005, 02:54 PM

I am writing a web application that allows the user to enter large multimedia files, together with descriptions of what they contain. Therefore, each page contains string, number, date,... fields, together with a file selection dialog for the file to be uploaded.

If I implement this in the straightforward way, the user will have to wait quite a few minutes after completion of each form. Only afterwards, the next form will be displayed, and he can continue entering data and the next multimedia file. That way, he has to sit in front of his browser the whole day, entering data for a few minutes, waiting the rest of the time.

Therefore, I'd like to let him enter the file names, assisted by a file selection box, but not start the file upload immediately, instead remember the file name in my system and perform all the remembered uploads when it's convenient for the user. This would mean modularizing the file upload functionality, separating the file selection step from the actual upload step.

I'd strongly prefer not to assume anything running on the client but a HTML browser. People block, consciously or not, things like Applets, JavaScript, and other Scripts, so I wouldn't rely any of those will be available.

I know this is not a genuine Spring question, as the behavior of the input file element is determined by HTML. However, maybe I'm lucky here and someone has solved a similar problem before.

Comment

That security argument is valid, of course. If I stored the file paths and got the files later, I might change the paths, therefore getting whichever file from the user's disk that I might be curious to see.

So maybe I'll offer both mechanisms, so that users who trust the application can have some comfort, and the others stick to the traditional html way.