1

I have implemented dropzone.js in my web application. I am trying to get the full path of the file which the user selects. Everything works perfectly as of now, expect to get the path. the progress and success function works correctly.

I am trying to use the sending function but it does not give me any response and the function is not triggered.

var dropZoneObj = jQuery("#drop").dropzone({
    filesName: 'dfiles',
    url: "{{action('SomeController@processAttachments',['pid' => $pid])}}",
    text: '+ Add more attachment',
    width: 250,
    height: 100,
    progressBarWidth: '100%',
    maxFiles: 10,
    uploadMode: 'single',
    maxFileSize: '5MB',
    allowedFileTypes: 'jpg,jpeg,png,gif,xls,xlsx,doc,docx,csv,txt,pdf',
    params:{
        '_token': "{{csrf_token()}}",
    },
    // this is not getting called
    sending: function(file, xhr, data){
        console.log(file, xhr, data);
    },
    progress: function(file, xhr, data){
        jQuery('#defectSubmit').prop('disabled', true);
    },
    success: function(res, index){
       console.log(res, index);
    }
});

I expect the output to be the file name in the sending function but I am getting empty.

Any help would be highly appreciated.

Rehan
  • 85
  • 2
  • 2
  • 8

0 Answers0