0

I am trying to upload the image to ./../public_html directory in laravel 7. However, the image always goes to lsapp/app/public/ directory.

In my Controller,

$storagePath  = $request->donation_poster->storeAs('public/donation-poster', 'donation-poster-'.time().'.jpg');

config/filesystems.php

'public' => [
        'driver' => 'local',
        'root' => storage_path('app/public'),
        'url' => env('APP_URL').'/storage',
        'visibility' => 'public',
],
'links' => [
        public_path('donation-poster') => storage_path('app\public\donation-poster'),
]

I think maybe the php artisan storage:link command isn't call, but i have no idea how to call using cpanel as it doesn't provide a terminal.

1 Answers1

0

I know what is issue, my directory in public_html isn't linked with the one in public/storage. The command solve my issue,

ln -s <target> <link>