Can someone please give me advice on how the technique of storing a temp file works.
For example I am creating a simple web Photo Gallery management. I am saving the PhotoGallery and the Photo information in the database using PhotoGalleryId as a foreign key. With each photo I am storing the FileName: i.e. (photoname.jpg). This way when I go and retrieve the photos from the database I can simply combine the filename with the root path to set the img src.
I would like to further enhance this so that when the user uploads the files a random generated filename is used rather then the one they had it names as to ensure it will always be unique. Additionally can someone explain the technique of using a temp directory and if I have to store the temp filename in the database (Photos table).