6 $renderer = $DIC->ui()->renderer();
9 if (isset(
$_GET[
'example']) &&
$_GET[
'example'] == 2) {
10 $upload = $DIC->upload();
19 echo json_encode([
'success' =>
true,
'message' =>
'Successfully uploaded file']);
22 echo json_encode([
'success' =>
false,
'message' => $e->getMessage()]);
27 $uploadUrl =
$_SERVER[
'REQUEST_URI'] .
'&example=2';
28 $dropzone =
$factory->dropzone()->file()->standard($uploadUrl)
29 ->withUserDefinedFileNamesEnabled(
true)
30 ->withUserDefinedDescriptionEnabled(
true)
31 ->withUploadButton(
$factory->button()->standard(
'Upload',
''));
33 return $renderer->render($dropzone);
if((!isset($_SERVER['DOCUMENT_ROOT'])) OR(empty($_SERVER['DOCUMENT_ROOT']))) $_SERVER['DOCUMENT_ROOT']