Don't know about your particular error, but here is a simple example of how to send additional data with dropzone using jQuery and receiving it with php on the backend.
html:
<form id="myForm" class="dropzone"></form>
js:
Dropzone.autoDiscover = false;
$('.dropzone').dropzone ({
url: "upload.php",
init: function() {
this.on("sending", function(file, xhr, formData){
formData.append("fpos", 777)
}),
this.on("success", function(file, xhr){
alert(file.xhr.response);
})
},
});
The success event is only to demonstrate how to access the response send from the server:
php:
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest')
{
echo "RECEIVED ON SERVER:
";
echo "FILES:
";
print_r($_FILES);
echo "$_POST:
";
print_r($_POST);
}
The php simply sends back to client the same data received, just to show where is accessible.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…