如何将多张图像保存到临时文件夹以便在确认上传之前进行预览?

发布于 2024-12-15 05:21:31 字数 379 浏览 3 评论 0原文

我有一个网站,我想让用户选择多个图像上传到该网站,向他们展示所上传图像的预览,然后让他们选择更改任何图像或继续上传它们。

我希望他们:

  1. 选择图像
  2. 单击提交按钮并将图像保存到临时位置
  3. 重新加载显示他们上传的图像的页面,每张照片旁边都有一个“更改照片”按钮
  4. 用户可以单击“更改照片” ”按钮让页面重新加载上传表单,以便用户可以选择新照片并将其上传到临时位置并替换有问题的照片
  5. 或者用户可以单击“上传照片”按钮确认上传并将其保存在

我正在使用的 永久位置php,但我不介意涉及 javascript 和 php 的解决方案,只要满足上述条件即可。如何将多张图像保存到临时文件夹以便在确认上传之前进行预览?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

断爱 2024-12-22 05:21:31

只是一个建议,您可以使用 jQuery uploadify 通过 ajax 上传多个图像并保存在某个临时文件夹中,然后再次显示这些上传的图像,当用户确认上传时,您可以将这些图像移动到目标文件夹中,将其从临时文件夹中删除文件夹。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文