在DropzoneJS中将数据传递给php [重复]

This question already has an answer here:

I am a fresher to use DropzoneJS. this is my form

<div class="col-md-12">
    <form action="upload.php" enctype="multipart/form-data" class="dropzone" id="myDropzone" method="post"></form>
    <select id="category" style="display: none;">
        <option value="">Select Category</option>
        <option value="cat1">Category 1</option>
        <option value="cat2">Category 2</option>
        <option value="cat3">Category 3</option>
    </select>
    <span id="caterr" style="color: red"></span>
    <button id="submit-all" style="display: none;">Submit all files</button>
</div>

And here is my dropzone code

Dropzone.options.myDropzone = {
// Prevents Dropzone from uploading dropped files immediately
autoProcessQueue: false,
acceptedFiles: ".png,.jpg,.jpeg",
maxFilesize: 2,
parallelUploads: 20,
addRemoveLinks: true,
    init: function() {
        myDropzone = this;
        $("#submit-all").click(function(){
            myDropzone.processQueue();
        })
    }
};

And Here is php

if (!empty($_FILES)) 
{
    $filename = $_FILES['file']['name'];
    $tmpFile = $_FILES['file']['tmp_name'];
    move_uploaded_file($tmpFile,$filename);
}

Now the reuirement is i wants to send an <selected> Category to PHP Page. So i can insert php category in database. but how can i send this selected category to php page.

</div>

update your init by this codes

init: function() {
    myDropzone = this;
    $("#submit-all").click(function(){
        myDropzone.processQueue();
    });
    myDropzone.on('sending', function(file, xhr, formData){     
        formData.append('category',$('#category').val());
    });
}