扫描本地(用户)PC上的文件夹并将所有文件(图像)上传到网络服务器

发布于 2024-07-23 10:20:23 字数 116 浏览 6 评论 0原文

我希望我的用户可以从他们的电脑中选择一个目录并上传该目录中的所有文件,这样他们就可以上传整个专辑(目录),而不是单独上传每个文件。 我想问您是否可以使用 PHP 或 JavaScript 并且不使用任何框架。 谢谢

I wish my users could select a directory from their PC and upload all files from this directory, so they could upload whole album(directory) instead of uploading every single file separately.
I would like to ask you if this is somehow possible using PHP or JavaScript and without using any framework.
thank you

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

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

发布评论

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

评论(5

我要还你自由 2024-07-30 10:20:23

首先,PHP不能对用户的本地计算机做任何事情。 因为它永远不会在那里运行(除非用户的计算机也是服务器)。

JavaScript 在用户的本地计算机上运行,​​但未设置为处理此类事情。

Java 和 Flash 在用户的计算机上运行,​​并且可以进行设置来执行此操作。

查看 SWFUpload。 我强烈推荐它。

如果您需要 Java,请查看 RadUpload。 精简版是免费的。

需要注意的是,这些 Flash 和 Java 解决方案的作用都是接受用户的文件选择,然后将其发送到执行实际上传的 PHP 脚本。

First of all, PHP can't do anything to the user's local computer. Since it never runs there (unless the user's computer is the server also).

JavaScript runs on the user's local computer but isn't setup to handle things like this.

Java and Flash runs on the user's computer and can be setup to do exactly this.

Look at SWFUpload. I highly recommend it.

And if you want Java, check out RadUpload. The lite edition is free.

A thing to note, what these Flash and Java solutions both do is accept a file selection from the user and then send that to a PHP script which does the actual uploading.

戒ㄋ 2024-07-30 10:20:23

对于他们来说,上传包含多个图像的 .zip 可能更有意义 - 这在 PHP 中是可能的。

It would probably make more sense for them to upload a .zip containing multiple images - which is possible in PHP.

胡大本事 2024-07-30 10:20:23

我认为按照你的描述这是不可能的。 创建一个小型实用程序,让他们可以在自己的 PC 上运行来完成这项工作。 另请查看 Facebook 上传图片的工作原理。 他们同时上传数十张图像。

I do not think it is possible as you describe it. Create a small utility which they can run on their PC that will do the job. Also check out how Facebook upload image works. They upload dozens of images at the same time.

浅忆 2024-07-30 10:20:23

Not possible using purely php/javascript. However, take a look at http://www.element-it.com/JavaPowUpload.aspx, it is a java-based file uploader that allows you to completely hide the interface, and, if you wish, power the whole interface via javascript. However, it is not free, perhaps not suitable for a personal project.

娇纵 2024-07-30 10:20:23

这可能无法满足您对 Javascript 的要求,但如果您希望可以将上传器对象构建为 activex 对象,并使用 CURL 实际执行上传或将其作为 Java 小程序执行。

我为客户构建了一个基于 Java 小程序的上传器,我在网上找到了资源,并将其用作构建上传器的基础。

SWFUpload,正如您收到的答案之一中提到的,这是一个很好的答案。

This may not meet your requirement of Javascript, but if you wish you could build your uploader object as an activex object and use CURL to actually perform the upload or do it as a Java applet.

I had built a Java applet based uploader for a client and I found resources on line and used that as my base for building the uploader.

SWFUpload, as mentioned in one of the answers you received is a good one.

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