Hey peaps using dropzone here to upload some files to my server. At the moment i configured it to not upload till i click the upload button so i can manage and rearange files in the queue. When i upload them, in my back end i get this array structure for my files:
$_FILES['file']['name'][0] == "my-first-file-name.xls"
$_FILES['file']['name'][1] == "my-second-file-name.sml"
$_FILES['file']['tmp_name'][0] == "my-first-file-tmp-name"
$_FILES['file']['tmp_name'][1] == "my-second-file-tmp-name"
I think the correct, as i used before with other technologies, is:
$_FILES['file'][0]['name']
$_FILES['file'][0]['tmp_name']
$_FILES['file'][1]['name']
$_FILES['file'][1]['tmp_name']
What am i doing wrong?
changing paramName: option to "files[]" doesnt work.
javascript
$(document).ready(function() {
$("#button").click(function (e) {
e.preventDefault()
var myDropzone = Dropzone.forElement(".dropzone");
myDropzone.processQueue()
});
})
Dropzone.options.myAwesomeDropzone = {
paramName: "file",
maxFilesize: 5,
uploadMultiple: true,
maxFiles: 10,
acceptedFiles: ".xls, .xml, .xlsx",
addRemoveLinks: true,
autoProcessQueue: false,
parallelUploads: 10,
dictDefaultMessage: "<strong>Arraste os arquivos aqui ou clique para selecionálos. </strong>",
dictInvalidFileType: "Este tipo de arquivo não é permitido.",
dictRemoveFile: "Remover"
};
html
<form action="/files/fileImport" class="dropzone" id="myAwesomeDropzone">
</form>