3

I have a site where I would like to let users select multiple images to upload to the site, show them a preview of the images they uploaded and then give them the option to either change any of the images or to go ahead and upload them.

I would like for them to:

  1. Select the images
  2. Click a submit button and have the images save to a temporary location
  3. Reload the page showing the images they uploaded with a "Change Photo" button next each photo
  4. The user can click on the "Change Photo" button to have the page reload with an upload form so that the user can pick and upload a new photo to the temporary location and have it replace the photo in question
  5. Or the user can click on the "Upload Photos" button to confirm the upload and have it save it in a permanent location

I am using php, but I don't mind a solution that involves javascript with php, as long as the above criteria is met. How can I save multiple images to a temporary folder to preview before confirming the upload?

zeckdude
  • 15,877
  • 43
  • 139
  • 187
  • 2
    Huh? You have stated the process completely in your question... Why not just implement that process in PHP? Have a form that uploads and save to a temp folder, and store the filename an array in the $_SESSION variable. – iWantSimpleLife Nov 14 '11 at 04:20
  • 1
    Remember to have a cron job that clears the temp folder once in a while, if not, you will run out of disk space pretty soon. :) – iWantSimpleLife Nov 14 '11 at 04:21

1 Answers1

1

Just a suggestion, you can use jQuery uploadify to upload multiple images through ajax and save in some temp folder, and again display these uploaded image which when confirmed by user to be upload then you can move those images to your destination folder deleting it from temp folder.

Sudhir Bastakoti
  • 99,167
  • 15
  • 158
  • 162