简体   繁体   中英

Laravel - cannot load resources from public folder

I have form for uploading images in Laravel 5.3. These images are uploaded into directory ( project_root/public/uploads/images/ ). When I turn on the URL example.com/public/uploads/images/filename.png (eg) or example.com/uploads/images/filename.png , I only get 404 NotFoundHttpException .

The images, of course, there are. But I cant dump the contents of a public folder over URL.

Can you help me please? Thanks!

The 'correct' way is to use your Storage facade and store it in the storage/public folder.

This folder is like your public folder, but you can apply all kinds of logic that you don't want to put in your public folder.

Without knowing more about how you are 'dumping' the contents of your public folder (with code or just a get request?) or how you are saving your files, i can't tell you what the problem is. It could be you have made a custom .htaccess rule?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM