i am using one form-element for uniform (https://github.com/mzur/kirby-uniform) from @mzur to post data with a submit button. this works well alone.
i also have a form element for dropzone.js (https://github.com/enyo/dropzone), which does not have a submit button. the form uploads the files correctly.
but once i use dropzone to upload a file. the submit button does not send the uniform data anymore.
maybe the uniform token gets rejected? any ideas how to find out more?
this is how my controller looks…
$form = uniform('datensatz', [
'required' => [],
'guard' => '', // disabled, has authentification
'actions' => [
[
'_action' => 'log',
'file' => './upload/datensatz.log'
]
]
]);
if(!empty($_FILES) && !isset($_POST["_submit"])) {
$upload = upload(
$page->root() . DS . '{safeName}.{safeExtension}',
array(
'input'=>'file',
'accept' =>
function($media) {
$ext = f::mimeToExtension(f::mime($media->root()));
return in_array($ext, array('jpeg', 'jpg', 'pdf'));
}
)
);
if(!$upload->error) {
$data = [ 'filename' => $upload->file()->filename(), ];
die(response::json($data, 200));
}
}