0

I am using Dropzone:

jQuery(function () {

    let dropzone = jQuery("#upload-box")

    dropzone.dropzone({
        url: "/file/upload",
        autoProcessQueue: false,
        addedfile: function (file) {
            console.log(file)
        }
    })

})

On added file I wan't to add it to an input <input type="file" name="file">. I know how to create to input but don't know how to add the file, so when I submit the whole form to get it in the $_FILES array on the server. #upload-box is div, not a form and that's why I want to add every file in <input type="file" name="file">.

Toma Tomov
  • 1,476
  • 19
  • 55

1 Answers1

0

I don't think that is possible. Please see this link: Set value of type="file" via jquery

I think you should upload files with ajax (xhr) asynchronously as they are dropped on the div.

efenacigiray
  • 340
  • 6
  • 16