I have an image upload form. When a user selects an image, the image will be displayed, along with a new input Form for title, and submit button. I know how to do this.
Idea being, save the image and title only if user clicks final submit.
To do this, should I save the image and update the database in the first step itself? or can I upload to temp, and if user submits in step two, proceed to move the file to final destination and update db?
You should have your form wait for the user submit. Otherwise your database will overflow with the undone (or temp) title and image name. When user click submit then the upload process is begin and test the upload result if true=insert into your_table values(…).