Closed GulomovCreative closed 5 years ago
We have a plugin that should fired the "OnFileManagerBeforeUpload" event:
if(condition) { $source->addError('path', 'Some error text'); }
We see our custom error text, but file will uploaded:
If we try to use exit, the file won't upload, but we don't see our error text:
if(condition) { $source->addError('path', 'Some error text'); exit; }
It would be nice if it would be possible to interrupt the file upload.
MODX Revolution 2.6.5-pl
Need to set error to true, thanks to @pavel-one
$modx->event->params['file']['error'] = 1;
Summary
We have a plugin that should fired the "OnFileManagerBeforeUpload" event:
We see our custom error text, but file will uploaded:
If we try to use exit, the file won't upload, but we don't see our error text:
Notes
It would be nice if it would be possible to interrupt the file upload.
Environment
MODX Revolution 2.6.5-pl