Hi all
Sorry for a basic question.
I'm trying to upload files to public folder on production server (shared hosting).
I've created a public drive uploads in config/filesystems.php with the following configurations
'uploads' => [
'driver' => 'local',
'root' => public_path('uploads'),
'url' => env('APP_URL') . '/uploads',
'visibility' => 'public',
],
storage link is also established.
When file is uploaded $flag_icon->storeAs('countries', $filename, 'uploads');
it is moved to app/public/uploads folder, I want it to be moved to public_html/laravel/public folder.
How can this be established?
@abiddev You should not be trying to store user-uploaded files in a publicly-accessible directory. This is a security risk, as if a bad actor uploads a file with malicious code, they now have a back door into your server since you make it nicely accessible for them via a URL.
Instead, you should be uploading files to a private directory, and then generating thumbnails for display in your website.