ok I have a file upload where people can upload their images. they are stored in a database. now I want to preview that image before iti is stored in the database, how can I do that?
well, before your script add this this image to your database, it's copy it to php tmp dir, from wich U can do with this file any stuff U want, U can move it to another dir, and after copy to DB, also U can make settling where will be stored all uoploded images, and from settling U will be move them to DB manually.
you have to make additional page, with form, kinda "Are You Sure?", and write something like this
<img src="fetch.php?id=1">
in fetch.php you must make select query, send appropriate header(s) and file body
Wave maybe better to take this image form TMP dir then??? Because if Do not shure then he'll be need to remove this record from db.
oh. i forgot about it.
but i suppose the problem is not "from where", problem is "how", so you MUST excuse mua (crying)
and by the way - sorry for for my bad... 😉
I guess the first thing to clear up is: "Who needs to preview the image?" Do you (as the site administrator) need to preview the images, or do you want to allow the person uploading the image to preview it?
I want the person so see a preview of the image, how it will look on the page when he uploads it.
so you have to store image in temporary folder (as i know, server delete uploaded files after and of script execution) and show it to your visitor. after submitting second form you must store image to the DB.
mmmmmm..... where problem is?