jaysalvat / ezdz

A jQuery plugin to turn any standard input type file into a nice drag & drop zone with validators and previews.
MIT License
89 stars 36 forks source link

Using Ezdz without upload button #6

Closed rsm23 closed 9 years ago

rsm23 commented 10 years ago

Hi; Is there any way to use Ezdz without upload button, I want the upload to be started when the user drops the file, and what I want exactly is to use the drop event as the submit for my form; And thanks alot

jaysalvat commented 10 years ago

Hello,

Yes, you can use the accept callback. https://github.com/jaysalvat/ezdz#accept

The dropped file is passed.

{   accept: function(file) {
    console.log(file);
}

file.data contains the file content. You can send it to your server by ajax.