Skip to content

Instantly share code, notes, and snippets.

@Maelstromeous
Forked from rossriley/extend-upload.php
Created November 14, 2016 13:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Maelstromeous/f0bcabc80d02ae2cef7ffd1d3c4e4ea4 to your computer and use it in GitHub Desktop.
Save Maelstromeous/f0bcabc80d02ae2cef7ffd1d3c4e4ea4 to your computer and use it in GitHub Desktop.
<?php
// This line needs to be called after initialize but before run
$app['upload'] = $app->extend(
'upload',
function ($handler, $app) {
if ($app['request']->get('contenttype') && $app['request']->get('id')) {
$handler->setPrefix("/{$app['request']->get('contenttype')}/{$app['request']->get('id')}/");
}
return $handler;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment