[eluser]rvillalon[/eluser]
I have an "add product" section on my site in which I use flash+jquery to upload images relating to products. It saves images to my website before creating the product. So, sometimes, if I upload images and don't go through creating the product, it just sits in my server.
I'm trying to improve my system so I was wondering what would be a good way to temporary save the images?
In a nutshell, once a product is added, temporary images get linked to their respective product.
I figure I have two options:
Option 1 - Sepeaated
- Have a temporary upload directory (/temp_images)
- Have a saved upload directory (/saved_images) - once the user saves the product, the images get moved here
- Have an images_temp table to track the temporary images (file name, who it belongs to, upload datetime)
- Have an images_saved table to storehouse the saved images
Option 2 - Not separated
- Store all images (temporary or not) in one folder
- Have one image table to track the images
Everyday, I would run a script to clean up any temporary images laying around.
Which option is better? And why? If you have database design tips too, that would help!
Any comments are greatly appreciated!