Hello friends, I have a form where people upload images and other information. Once the person finished filling the form a PREVIEW PAGE will come to show the information filled in the form. The problem is that i don't know how to temporarily save the uploaded image and use session to carry it to the PREVIEW PAGE in order to preview it with other information and also how to same it permanently if the person clicks submit or delete it if the person clicks EDIT. I need your assistance. Regards, adsegzy
Have 2 upload directories. One for previews and one for the final saved ones. So when they upload the file you save it to the previews directory and store the filename in a session variable. Then on the preview page do whatever you have to do, and in the script that handles the submit and delete buttons you then either delete the file with the php delete() command or move it to the permanent directory. You can move files around in php with rename().
Also, forgot to mention... you can have some sort of cronjob or something similar to clean up the previews directory occasionally (eg. delete all files older than an hour).
By default all HTTP uploads are saved to the temporary directory (/tmp) so you can use that and if you wish to save it....use move_uploaded_file() You can set the tmp_name as a $_SESSION, so it can be retrieved on other pages.