Monday, August 22, 2011

Neat asynchronous uploads

I am letting people upload multiple documents at a time to be added as revisions to existing documents. If the file name matches it shows them the revs that exist.
While they enter a description for the files the upload moves the files to a temp folder:
I move the files asynchronously using a hidden iFrame and a target on the form pointing to the name of the iFrame. The php thats echoed there includes js that will change a button from loading to Open for each file so they can open pdfs from the files temp location.
Without refreshing I upload the document and allow them to open it while its in a temp folder on the server. Then when they have finished adding a description for it then the file is moved to the real folder where all the other files are. The database has a hierarchical table that shows where in the virtual folders for these files are even though they are in the same folder in the physical server.

No comments: