Jump to content

Image upload with Preview


jas511

Recommended Posts

Hi - I have a script that uploads an image to a server. But I'd like the user to be able to preview the image (along with some other text) before submitting. I'm not really sure how to create the preview page for the image. Usually for a form I'll store the data in hidden fields but I don't know how to do that with files. Maybe I could use session variables, but I'm wondering if that's the way to go.

 

Thanks,

Jeff

Link to comment
https://forums.phpfreaks.com/topic/123069-image-upload-with-preview/
Share on other sites

Well you will need to "upload" it physically first but then flag it in the database (or somewhere) that it is a "preview" file not the actual file.

 

Then when approved changed the flag from "preview" to "live"

 

Then make a garbage collector that kills all images that were left as previews for say more than 1 day so you don't fill up your server.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.