image upload, resize THEN submit form
Posted on
16th Feb 2014 07:03 pm by
admin
Ok so I have a form that requires the user to upload an image, and then do something with that image (using some ajax scripts), then fill out the rest of the form and submit. I have the upload script pretty much working, my problem is that I need to store the uploaded images temporarily just in case the user decides not to submit the form
Here's the process I would need:
1) Form loads
2) User fills out form
3) User uploads image (php + ajax)
a) image is resized to a large and thumbnail image using imagecopyresampled()
b) fullsize and thumbnail images should be stored in a temporary location ??
4) Image is dynamically displayed in the form after upload and resize (using some jQuery/ajax magic)
5) User performs some action to the uploaded image (using jQuery/ajax)
At this point, the user can submit the completed form, at which time a php script will will move the temporary (resized) fullsize and thumbnail images from the temp location to a permanent location on the server, and if the file saving succeeds, then it will write the form data to a MySQL server.
BUT if the user doesn't submit the form, I need the temporary files to be deleted.
Normally this would be handled by the temporary files being stored by the $_FILES array, but since I have to resize them after upload, the $_FILES["upload"]["tmp_name"] is automatically deleted after I resize it.
Please suggest an alternative solution. As I said, the upload script is done. It can upload and resize the images, but I need a way to store the images temporarily until the form is submitted.
No comments posted yet
Your Answer:
Login to answer
163
37
Other forums
Loop column after 2 results
Hello All.
Here is what I have:
Client ID Company name Clien
Relative path
I have a absolute path to an image - like so: C:/Program Files/Apache Software Foundation/Apache2.2/
Adding post count
How would I make it so everytime someone clicks submit on my form, their row in the database for the
Windows 7
Windows 7 default user account control worries experts. Corporate IT departments should be pleased w
How to Handle more than one submit button in single form?
Hi
I have one PHP file which contains one Form. In this form there are two Submit type Buttons
Displaying image pathname instead of image
Hello
Im trying to upload and then display images from a mysql database - Its only basic and
Members Only
Hi all, for my website i have a members area only which on members can veiw, but at the moment anyon
WHYISNT THIS MYSQL STATEMNT NOT WORKING? (php)
caps because its absolutely rediculous.
i dontunderstand why its not working. there is a column c
More pug propaganda.
http://www.youtube.com/watch?v=8Kkrmubsgf8
The commercial is definitely worth watching pug aw
Creation of Raw Exposure manually
SAP Gurus
I am creating Raw Exposure ( Hedge management ) thru T Code TEM10 with followin