Skip to content

Instantly share code, notes, and snippets.

@rossriley
Last active January 26, 2018 12:41
Show Gist options
  • Save rossriley/28cb0485d35d55063e0fb19b2d01e771 to your computer and use it in GitHub Desktop.
Save rossriley/28cb0485d35d55063e0fb19b2d01e771 to your computer and use it in GitHub Desktop.
Bolt: Extending the upload handler with custom sanitiser
$app['upload'] = $app->share(
$app->extend(
'upload',
function ($uploadHandler) {
$uploadHandler->setSanitizerCallback(
function ($filename) {
// Do things with filename string here.
return $filename;
}
);
return $uploadHandler;
}
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment