jas511 Posted September 6, 2008 Share Posted September 6, 2008 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 More sharing options...
cooldude832 Posted September 6, 2008 Share Posted September 6, 2008 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. Link to comment https://forums.phpfreaks.com/topic/123069-image-upload-with-preview/#findComment-635525 Share on other sites More sharing options...
jas511 Posted September 7, 2008 Author Share Posted September 7, 2008 Thanks for the input. Seems like there might be a lot of wasted bandwidth there though... Link to comment https://forums.phpfreaks.com/topic/123069-image-upload-with-preview/#findComment-635526 Share on other sites More sharing options...
cooldude832 Posted September 7, 2008 Share Posted September 7, 2008 well u can't produce the image on your server unless its stored on your server or somewhere in the realm of the internet so you can't avoid the bandwidth and instead of uploading twice upload once and flag Link to comment https://forums.phpfreaks.com/topic/123069-image-upload-with-preview/#findComment-635529 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.