How can I access uploaded images/ docs outside my public_html?
for instance, I have this structure,
lib/
upload/ (uploaded images and pdfs)
public/index.php
bootstrap.php
public/index.php,
// Include application bootstrap
require_once dirname(__FILE__) . '/../bootstrap.php';
$app->get('/about', function () use ($app, $log) {
echo '<p><img src="' . '/../upload/image/cat.jpg' . '"/></p>';
});
// Important: run the app
$app->run();
I can access bootstrap.php
via dirname(__FILE__)
but I can't do it with the images.
I follow this framework idea from this. But can I store my images and docs outside the public folder?
What about the javascript file?
I notise that most frameworks store these items in the public folder.