dimanche 3 juillet 2016

Formstone Upload - drop file on div didn't working

I need simply and tidy javascript library for upload image with drag&drop option. I found Formstone, but I have some problem with it. According to documentation I have created div:

<div class="target" style="border:dotted; width: 300px; height: 300px;"></div>

and just bind this div with formstone script:

$(document).ready(function(){
    $(".target").upload({
        action: "/upload.php"
    });
});

Now in my div appear input file - if I choose file by this input is ok (just check whether $('.fs-upload-input')[0].files[0].name return filename in console), if I dropped file on this input is ok, but if I dropped file on my div but not on input it's not works - internet browser just display file because Formstone library not catch to file.

I've made JSFiddle with sample.

The question is: why formstone not bind my div?

Aucun commentaire:

Enregistrer un commentaire