bulbulanwar's avatar

Unwanted upload images in public directory

My project is by Laravel6. I linked storage to upload images for my posts and categories. Images are uploaded correctly to the post and category sub-folders under the public/storage directory. But problem is, when ever I upload an image, a copy of the image stored in the public directory, no other sub-folder, just under the .htaccess file. I have no control over those images. When I delete a post or a category, related images in the post or category folder deleted as wanted, but images stored in the public folder remain. Now how I can stop this unwanted upload of images in the public folder?

0 likes
2 replies
bobbybouwmann's avatar

You need to upload your images to the storage/app/public directory instead of the public/storage directory. If you configure everything correctly in your config/filesystems.php and use the public driver there. You also need to run php artisan storage:link. After that, all uploads should go to the correct directory.

bulbulanwar's avatar

Thanks @bobbybouwmann , little late to reply. Actually I use Intervention and Storage here and save images by both way. First by Intervention and then in Storage, So images saved several directories. Now I only save in Storage. Anyway, problem solved. Take care.

Please or to participate in this conversation.