有没有好的 jQuery 拖放文件上传插件?

发布于 2024-08-09 22:46:00 字数 769 浏览 14 评论 0原文

是否有一个漂亮整洁的 jQuery 插件,允许包含单个 JS 脚本,然后使用简单的代码片段来启用表单?像这样:

$j('#MyForm').enableDragDropUploads('.upload-area')

上传目标是表单的操作。

任何解决方案都不得阻止常规文件字段的使用(使用传统的浏览方法)。

我一次只需要一个文件,当然可以选择多个文件并不是一件坏事。

我找到了几个拖放上传示例:
http://www.appelsiini.net /2009/10/拖放文件上传-with-google-gears http://www.appelsiini.net/2009 /10/html5-drag-and-drop-multiple-file-upload

但是那里的代码没有设置为插件。改变它可能并不太难,但如果其他人已经完成了这项工作并且只是逃避我的谷歌搜索,那么这样做也是没有意义的。

我理想地寻找一个纯 HTML5/jQuery 解决方案。
Google Gears 是可以接受的,但 Flash 解决方案则不行。

Is there a nice tidy jQuery plugin that allows including a single JS script then using a simple snippet to enable a form? Something like this:

$j('#MyForm').enableDragDropUploads('.upload-area')

With the upload target being the action of the form.

Any solution must not prevent a regular file field from being usable (using traditional browse method).

I only need one file at a time, though of course having the option for multiple isn't a bad thing.

I've found a couple of drag-drop upload examples:
http://www.appelsiini.net/2009/10/drag-and-drop-file-upload-with-google-gears
http://www.appelsiini.net/2009/10/html5-drag-and-drop-multiple-file-upload

But the code there isn't setup as a plugin. It's probably not too difficult to change it, but also no point doing so if someone else has already done that work and is simply evading my Google searches.

I'm ideally looking for a pure HTML5/jQuery solution.
A Google Gears one is acceptable, but a Flash solution is not.

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

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

发布评论

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

评论(7

樱花坊 2024-08-16 22:46:00

查看最近1发布的上传内容来自创建 TinyMCE 编辑器的人的处理程序。它有一个 jQuery 小部件,看起来有一组很好的功能和备用功能。

http://www.plupload.com/

Check out the recently1 released upload handler from the guys that created the TinyMCE editor. It has a jQuery widget and looks like it has a nice set of features and fallbacks.

http://www.plupload.com/

陪我终i 2024-08-16 22:46:00

http://blueimp.github.com/jQuery-File-Upload/ = 很棒的解决方案

根据他们的文档,以下浏览器支持拖放掉落:

  • Firefox 4+
  • Safari 5+
  • Google Chrome
  • Microsoft Internet Explorer 10.0+

http://blueimp.github.com/jQuery-File-Upload/ = great solution

According to their docs, the following browsers support drag & drop:

  • Firefox 4+
  • Safari 5+
  • Google Chrome
  • Microsoft Internet Explorer 10.0+
旧伤还要旧人安 2024-08-16 22:46:00

如果您正在寻找一个不依赖 Flash 的工具,那么 dropzonejs 是一个不错的选择。它支持多个文件和拖放。

http://www.dropzonejs.com/

If you're looking for one that doesn't rely on Flash then dropzonejs is a good shout. It supports multiple files and drag and drop.

http://www.dropzonejs.com/

乖乖兔^ω^ 2024-08-16 22:46:00

如果您仍在寻找,我刚刚发布了我的:
http://github.com/weixiyen/jquery-filedrop

目前适用于 Firefox 3.6。我决定暂时不进行 Chrome hack,让 Webkit 在 Safari 和 Chrome 的下一个版本中赶上 FileReader()。

该插件未来兼容。

FileReader() 是 XHR.getAsBinary() 之类的官方标准,根据 mozilla 的说法,XHR.getAsBinary() 已被弃用。

它也是据我所知唯一的 HTML5 桌面拖放插件,它允许您随文件一起发送额外的数据,包括可以在上传时使用回调函数计算的数据。

If you are still looking for one, I just released mine:
http://github.com/weixiyen/jquery-filedrop

Works for Firefox 3.6 right now. I decided not to do the Chrome hack for now and let Webkit catch up with FileReader() in the next versions of Safari and Chrome.

This plugin is future compatible.

FileReader() is the official standard over something like XHR.getAsBinary() which is deprecated according to mozilla.

It's also the only HTML5 desktop drag+drop plugin out there that I know of which allows you to send extra data along with the file, including data that can be calculated at the time of upload with a callback function.

魔法唧唧 2024-08-16 22:46:00

我创建了一个插件,它允许您将一些文件拖放到给定区域。该插件目前适用于 Firefox、Safari 和 Chrome。

http://code.google.com/p/dnd-file-upload/

I created a plugin which allows you to drop some files onto a given area. This plugin currently works in Firefox, Safari and Chrome.

http://code.google.com/p/dnd-file-upload/

ヤ经典坏疍 2024-08-16 22:46:00

无耻插件:

Filepicker.io 为您处理上传并返回一个网址。它支持拖放、跨浏览器。此外,人们还可以从 Dropbox/Facebook/Gmail 上传,这在移动设备上非常方便。

Shameless Plug:

Filepicker.io handles uploading for you and returns a url. It supports drag/drop, cross browser. Also, people can upload from Dropbox/Facebook/Gmail which is super handy on a mobile device.

狼亦尘 2024-08-16 22:46:00

最新版本的 jQuery Fileuploader 怎么样: http://pixelcone.com/fileuploader/

它是一个强大的文件上传功能插件,与其他插件相比非常容易设置,并且现在支持 html5 api。

How about the latest version of jQuery Fileuploader: http://pixelcone.com/fileuploader/

Its a powerful file upload plugin, very easy to setup compared to other plugin, and its now support html5 api.

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