How long do the files stay in the temp directory? basically i'm making an advertisement website. A user enters all the information and uploads an image. I then want them to be able to preview the advert (without the image). If they then click submit, I want it to be flushed into the database. however, I wanted to use the advert_id from the database to name the image file (i.e. input advert, last_insert_id = 123456, so the file is thumbnailed and saved to disk as 123456.jpg) It would therefore make it a lot easier if i could actually pass the file by the session and save it once i've put all the other info into the database. Hope that was clear... lol. Can I do this?