Settings

Theme

Dropzone.js - JS library for drag-and-drop file uploads with image previews

dropzonejs.com

206 points by professorplumb 13 years ago · 32 comments

Reader

nodesocket 13 years ago

Nice. We use jquery-filedrop, which is really simple, but does the trick.

https://github.com/weixiyen/jquery-filedrop

luney 13 years ago

Just add the ability to paste an image from the clipboard (on supported browsers obviously) and its great!

nachteilig 13 years ago

Looks pretty nice.

For what it's worth, it seems like a lot of the other players in this space have gotten popular by providing tutorials for usage with Rails, PHP, etc.

Might be worth a few paragraphs.

davekinkead 13 years ago

Nice.

After dragging a file to the drop board, I couldn't remove it (FF18 OSX10.7).

It would be nice if I could drag off as loading the wrong file seems to require a page refresh to undo.

graue 13 years ago

Anyone else finding that the demo is broken, particularly in Firefox on Linux? I filed an issue: https://github.com/enyo/dropzone/issues/34

koopajah 13 years ago

Pretty neat library. Any plans to connect to filepicker.io? Would love to be able to drag a file in my webapp for it to upload to filepicker automatically and haven't got the time yet to do it myself!

JuDue 13 years ago

Wish people would stop depending on jQuery.

Old browsers can default to a normal form input.

  • enyo 13 years ago

    You're not the first criticising this about my library. I used adapters in another lib of mine (http://www.opentip.org) and it worked great, but the work involved in testing all browsers is not comparable to just using jQuery (especially when working with events). But it is definitely on my todo list (https://github.com/enyo/dropzone/issues/39).

    EDIT: PS: I also chose jQuery over any other lib just because it's the most wide spread. Personally I have worked with Ender, Component, RequireJS and don't use jQuery in all my projects.

  • javascripter9 13 years ago

    Why do you wish people would stop depending on jQ? I'm just curious.

    • jblock 13 years ago

      For one, it's heavy compared to some very simple JS and a good portion of the time you don't need the entirety of the library.

      That said, it does abstract much of the crap that goes along with XMLHttpRequests and all the cross-browser idiosyncrasies that go along with it.

      I'd say at this point it's a matter of personal preference and performance requirements.

    • emehrkay 13 years ago

      Not everyone uses jQuery; I don't. This should be titled 'jQuery library...'

jwarren 13 years ago

Nice, though it would be awesome if it could client-side resize images over a certain size, like Plupload does. Helps to manage people uploading 4000px wide images straight out of their camera.

heyrhett 13 years ago

on iOS 6, iphone, I get a bug where it only shows me a fraction of the image I'm uploading in the preview.

Does anyone know why this is? I had the same issue with jQuery-File-Upload.

pandeiro 13 years ago

Quickly scanning the site and grepping the coffeescript source I didn't see any ajax support built in. That would make a nice option (if not the default).

BaconJuice 13 years ago

This is perfect, thanks for sharing!

juzfoo 13 years ago

always struggle trying anything related to drag n drop on my ubuntu 12.10, because the moment i drag a file on nautilus the entire sets of apps get disabled on my unity sidebar except firefox and nautilus. and even firefox doesn't open so basically am stuck :(

  • ZeroGravitas 13 years ago

    You can use the window pinning (not sure of the right word) to quickly move a window to take half the screen by dragging it to either side. Then you can do the same with the the other window. Once done dragging to the top will fullscreen it again.

  • enyo 13 years ago

    Dropzone also supports click to upload, so you do not HAVE to drag'n'drop. It's just cooler if you can ;)

rajivtiru 13 years ago

Thank god for this. So much easier to use this with Require JS instead of jQuery-File-Upload.

lancefisher 13 years ago

This is nice. Anyone know if it will work for direct uploads to S3?

  • cmer 13 years ago

    I've been playing with browser uploads for a few weeks now (including S3) and was too worried about the complexities of uploading to S3.

    I realized that there's nothing really fancy going on when uploading to S3. That's only true since Amazon added CORS support. Just add a few hidden form fields and you're good to go.

    Properly populating those fields can be a bit tricky, however. This gem will does a great job and should give you a head start: https://github.com/waynehoover/s3_direct_upload

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection