Is there any pre-existing mechanism or code way of uploading files with an automatic upload of a thumbnail?
Let me be more specific.
If I have an <input type=file name=file> on a form… I click submit and upload a file called ‘picture.jpg’
could I make the code also upload a file called tn_picture.jpg without having to have a second file input?
My host doesn’t have GD support so I can’t create thumbnails on the fly… so I have to create them manually offsite. The thumbnails will be in the name format tn_(filename).jpg so a file called wibble.jpg would be acompanied by a file called tn_wibble.jpg.
There’s no way to automatically populate a file input field (the browsers simply won’t let you do it for obvious security reasons, and Javascript doesn’t have access to your filesystem.)
You could do it by writing a whole little custom Java applet uploader, but that would be a whole big pain in the ass.
So you’re probably stuck with manually populating multiple file inputs. If this application is for any kind of public use, however, I’d strongly recommend getting a better host so you can generate the thumbnails server-side. Your users aren’t going to want to do actual work.
It’s not really that automatic. All that will happen is - once I click ‘browse’ on the main file input control the ‘thumbnail’ input control’s value will become the file input control’s value with the string ‘tn_’ added to the front of it… that way java doesn’t ‘know’ my file is there… it just assumes I know the file is there…
and it won’t be for public use… I’m building a system of uploading my own photos to display to the public. the uploading will be accessable by myself only, and the viewing of the photos will be public