Using jquery file upload synchronous not working on drop

January 24, 2017, at 00:17 AM

I'm using the plugin to display the image thumbnails and adding drag and drop to the page, then sending a form with other data.

When I click the button, select the images and submit the form, it display the thumbnails of the images that i have uploaded, and when the form is sended the input file show this:-


But when I drag and drop it still display the thumbnails of the images that i have droped, butg if i submit the form it won't work it show:-


This is the HTML

   <span class="btn btn-success fileinput-button">
     <i class="glyphicon glyphicon-plus"></i>
     <span>Add file...</span>
       <input id="fileupload" type="file" name="files[]" multiple>
   <div id="files" class="files"></div>

And this is the plugin's code

$(function () {
    'use strict';
    // Change this to the location of your server-side upload handler:
        dataType: 'json',
        autoUpload: false,
        acceptFileTypes: /(\.|\/)(gif|jpe?g|png)$/i,
        maxFileSize: 999000,
        replaceFileInput: false,
        // Enable image resizing, except for Android and Opera,
        // which actually support image resizing, but fail to
        // send Blob objects via XHR requests:
        disableImageResize: /Android(?!.*Chrome)|Opera/
        previewMaxWidth: 300,
        previewMaxHeight: 300,
        previewCrop: true,
        autoUpload: false,
     }).on('fileuploadadd', function (e, data) {
        data.context = $('<div/>').addClass('uploadedFile col-xs-12 col-md-6').appendTo('#files');
        $.each(data.files, function (index, file) {
            var node = $('<p/>')
                    .append("<span class=\"remove\"><i class=\"fa fa-times fa-2x\"></i></span>");
            if (!index) {
    .prop('disabled', !$.support.fileInput)
        .parent().addClass($.support.fileInput ? undefined : 'disabled');

How can I make the drag and drop work?

JS interconnected molecular banner

JS interconnected molecular banner

I am looking to create a homepage banner that does pretty much this: http://liveplasmacom/ (takes a bit to load) but not in flash

json request and respond with nodejs

json request and respond with nodejs

i am trying to send json request with nodejs but somethink is wrong here and i cant not figure outmy code is like this

Trouble with basic JavaScript loop

Trouble with basic JavaScript loop

I'm a newbie in JavaScript programmingAt our university we were just beginning to learn about JavaScript loops

Interactive webpage with JS editor

Interactive webpage with JS editor

I want to create a webpage that has a working code underneath it but interactively parts can be changed