I'm in the middle of remaking a decent jquery uploader for my admin sites and 
here is what i do ( for the whole upload):

1. photo uploaded via jquery & flash and sent to a cfc, I send a long with the 
file variables for file size, mime & whether or not I want to run the virus 
scanner. I do not try and rename yet.

2. File is run through cffile to upload and I have set up a small partition on 
another hd on the same server thats only purpose is to have a safe place for 
uploading and processing before delivery to final folder.

2a. runs antivirus check if it is selected with clamav. If it reports as a 
virus it is renamed with the site it came from(this uploader is for server), 
clamps permissions down on it and moves it to quarantine folder and emails me a 
message with all the info.

3. after uploading it runs a java mime check

4. then runs a file size check

5. if it passed those it moves the file to a processing folder and then renames 
the file with a uuid for a temp file name.

6. run a scan of upload folders and delete any orphaned files over 1 hr old.

7. pass the temp uuid back to the upload script which inserts it into a hidden 
form field, it also gets additional variables for the image processing at this 
time and inserts them into form as well. These are for things like final img 
size, thumb size, dest folder name, conver image, convert to, etc..

8 user fills out rest of form and submits via ajax to cfc again and final 
processing starts.

9. checks the destination folder to make sure it exists if not create it and 
any additional folders needed (large, thumbs, additional, files)

10. gets image info for height and width

11. create new name... either use part of the form that was submitted if it has 
any seo worth, like if it's an employee profile then I would use their first 
and last name then company name then just to be extra special(not like Don 
special) I will add the date at the end so would end up like: 
john-doe-acme-drugs-09212009.jpg, of course if they are adding more images then 
put a counter on it.

12. if it's just a file them move it now and add info to db

13. if its an image then I convert it to a png and then back to whatever format 
you passed in. I do this to strip jpg exif data out without loosing quality.

14. then i check the height and with against the uploaded imag height and width 
against the size of the large img var that was passed in and if bigger than 
resize down

15. sharpen it and copy it to the final folder

16. do the same with thumbs

17. if additional image is set do that here now as well

18. if all is ok then enter it all into db and send back ok message to upload 
script, if not ok then it rolls back and fetches imgages and deletes them.




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325626
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to