Support the ongoing development of Laravel.io →
Security Validation Architecture

Dear friends, i can upload any file with validation to public folder, but what i need to know is how to limit users to access only their upload folder, also i need to restrict guests from accessing any of the users upload folder. What i'm sure about, is changing the upload folder path to something else that public folder but i really don't know what i must do? Thank you for helping.

Last updated 3 years ago.
0

You have some choices from my suggest : First. If you choose to separate user upload folder, you must create folder when you run upload action. And when user logged in you just compare the username with your folder name. If same, the user can access it. If not, redirect it to error page.

Second. You create table that contains user and user file. So you can see which user that have which file.

Sorry for my bad English. Hope this help. ^^

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.