I have a form that includes an image upload, which upon submission, needs to generate a preview.
I can think of 2 options…
- Save the image to a directory the normal way, and then call it back to generate the preview
Pros: I think I can do it.
Cons: I would have to save the image to my directory before I know if the person actually went through and created the post. They might just preview it, and then close their browser, and then I’d be stuck with a useless image just taking up space. This will create maintenance issues later on.
- Open the image right away, before saving it to my directory
Pros: I wouldn’t save something I didn’t need
Cons: I don’t know how to open a file in the $_FILES array.
I tried:
[php][/php]
I think that the “…” means go up one level, and then I tried to find the location of where the temporary files are stored, thinking the $_FILES would go there. This doesn’t work.
Does anyone know if it’s possible to DISPLAY an image that is only saved in $_FILES array?