Skip to content

Instantly share code, notes, and snippets.

@rossriley
Last active April 16, 2018 12:47
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rossriley/31037198c925ec137014 to your computer and use it in GitHub Desktop.
Save rossriley/31037198c925ec137014 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('contenttypeslug') && $app['request']->get('id')) {
$handler->setPrefix("/".$app['request']->get('contenttypeslug')."/".$app['request']->get('id'));
}
return $handler;
});
@eduardomart
Copy link

put it in public/index.php at this line: https://github.com/bolt/bolt/blob/release/3.1/index.php#L8

@zomars
Copy link

zomars commented Feb 28, 2017

If I understand this correctly, does this upload the files to a folder named after the content type and then into another with the record id?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment