托管在网站上的真正跨平台本地文件资源管理器

发布于 2024-12-21 09:34:07 字数 575 浏览 0 评论 0原文

我再次问这个问题,仍然找不到合理的解决方案。 我需要构建一个网络工具 - 文件上传器,它使您能够浏览用户计算机上的本地文件(图片)并上传它们。不仅是文件,还包括整个目录。 应该是跨平台的。至少它应该可以在 PC 和 Mac 以及最新的主要浏览器上运行。

JavaScript 不允许你这样做——无论好坏。我希望能够通过 Silverlight 做到这一点。为了做到这一点,我需要在浏览器外模式下以更高的信任度运行该应用程序。我在这里找到了一个很好的例子。不幸的是,它不适用于 Mac,仅适用于 Windows。

  • 我认为没有办法欺骗 SelectFile 对话框以使其能够选择多个文件和目录,是吗?

  • 我想知道,也许有一种方法可以实现一些刚刚推出的 SL 5 新功能?

  • 我认为 Flash 不可能实现这一点...(?)

请帮帮我。真的需要你的建议。谢谢。

Once again I'm asking this question, and still can't find any reasonable solution.
I need to build a web tool - file uploader which gives you ability to browse local files (pics) on the user machine and upload them. And not just files but also entire directories.
It should be cross platform. At least it should work on PC and Mac and in the latest major browsers.

JavaScript doesn't allow you do that - whatever for good or bad. I hoped that I could do that with Silverlight. In order to do that I'm gonna need to run the app in out-of-browser mode with elevated trust. I found a good example here. Unfortunately it doesn't work on Mac - only Windows.

  • I don't think there is a way to trick SelectFile dialog to make it able to select multiple files and directories, is there?

  • I wonder, maybe there is a way with some new SL 5 features, which is just came out?

  • I don't think that would be possible with Flash...(?)

Help me out here guys. Really need your advice. Thank you.

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

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

发布评论

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

评论(2

匿名的好友 2024-12-28 09:34:07

在我看来,如果您正在寻找完全跨平台的解决方案,您应该简单地依赖浏览器提供的功能,而不必费心使用 Silverlight 或其他非标准技术自定义文件选择对话框。

Javascript是跨浏览器和跨平台的(如果您在 JQuery 的帮助下编写了良好且独立于浏览器的代码...),任何其他类似 SL 或基于插件的方法都将被破坏或不受支持某处。

如果您使用默认的浏览器文件选择对话框,您确信您将毫无痛苦地使用该平台中该用户可用的内容,并且随着时间的推移,未来的浏览器版本可能会对此进行改进,并且与您的应用程序分离。想象一下,最终您也可以在 Android 平板电脑和 iPad 上使用此功能...免费且无需额外的努力,只要您可以放松一次选择整个文件夹的要求,并将其替换为选择中的所有文件的技巧。该文件夹(我猜是 Windows 中的 Ctrl+A)...

PS 这也可以作为评论发布,但我作为答案发布,因为我希望这确实可以帮助您理解任何非标准实现在短期内可能都是好的期限,但通过合理的努力并不会真正持续或保持稳健。

In my opinion if you are looking for fully cross-platform solution you should simply rely on what the browser offers and don't bother in customizing the file selection dialog with Silverlight or other non standard technologies.

Javascript is cross browser and cross-platform (if you write good and browser independent code also with the help of JQuery...), anything else like SL or plugin based approach is going to break or be unsupported somewhere.

if you use the default browser file selection dialog you are sure you will use what is available for that user in that platform with no pain and this could be improved over time by future browser versions and is decoupled from your application. Imagine that eventually you could get this working also on Android Tablets and iPads... for free and with no extra effort, if you simply can relax your requirement of selecting a whole folder at once and replace it with the trick of selecting all files in that folder (Ctrl+A in windows I guess)...

P.S. this could also have been posted as a comment but I post as an answer because I hope this really helps you to understand that any non standard implementation is probably good in the short term but not really going to last or be robust with a reasonable amount of effort.

与往事干杯 2024-12-28 09:34:07

毕竟,Silverlight 似乎很有可能实现这一点。下一个问题提供了部分答案。

Silverlight 5 可信模式。访问文件系统和本地驱动器

Seems tt is quite possible with Silverlight after all. Next question partly provides an answer.

Silverlight 5 Trusted Mode. Accessing FileSystem and Local drives

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