0

Is there any way to store the uploaded file as a html element like in file input in dropzone.js? And not upload automatically?

I have referred these, but didn't helped.

  1. Saving dropzone uploaded files to array
  2. use dropzone without auto uploading

Currently I'm directly uploading the files to the server on drop like this,

$(this).dropzone({
        url: base_url + 'document-manager',
        addRemoveLinks: true,
        dictDefaultMessage: 'Drop files or click here to upload',
        maxFiles: 1,
        init: function () {
            myDropzone = this;
            myDropzone.on("success", function (file, response) {
                fileId = response;
            });
            myDropzone.on("removedfile", function (file) {
                $.ajax({
                    type: "delete",
                    url: base_url + 'document-manager/' + fileId,
                    async: false,
                    data: {'_token': $('[name=_token').val()}
                }).responseText;
            });
        }
    });

Now I want to send the files as the file input. Is it possible in dropzone.js?

P.S. I just want to store the selected file from dropzone to store in some custom file input.

Keyur
  • 1,113
  • 1
  • 23
  • 42
  • Your question is not quite clear. Do you want to upload file to server from url placed in the input? Or do you want to upload some html data from i.e. textarea input as file to server using dropzone? – Nikola Kirincic Jun 23 '18 at 13:04
  • I just want to store the selected file from dropzone to store in some custom file input. @niklaz – Keyur Jun 23 '18 at 13:07

0 Answers0