I have a custom form built using the form API. For usability and to avoid browser timeouts, I need a way to display an "upload in progress" indicator while large files are being uploaded to the server.
The file upload module has a nice javascript/hidden iframe functionality that handles this. (It displays a graphic as the file uploads.) However, this behaviour is only invoked if a user clicks the "attach" button. If the user clicks submit (without having clicked "attach" beforehand), the file is uploaded without any indication that the upload is in progress.
Any ideas? Can I add the "attach" button's behaviour to the submit button?
Or is there a way to use javascript to automatically submit the entire form after a file has been attached using the "attach" button? (In this use case there will only be one file uploaded at a time.)
I have also looked into doing file uploades without using the file upload module. I'd prefer to stick with the core module, but if there are ideas for other approaches please let me know.
Thanks very much for your help!