Reputation: 1509
For example, I want to merge two .png files in one .png file, but I don't want to share those parts with user. Currently I am storing files in storage folder, but the problem is that storage folder is with .gitignore file as default. Of course I could allow to push it to git, but I suppose it's not a good idea, because there could be thousands of another files uploaded by the user. Now if I want to continue work from another computer I should move all my parts manually.
So what you could advice to me?
Upvotes: 1
Views: 283
Reputation: 2353
If you want to protect your files so that nobody can access without permission store all file into storage folder. Don't put your file in public folder.
Upvotes: 0
Reputation: 4285
You can store it anywhere you want in your application.
For example, you can make a folder in your projects root called /uploads
and then use one of laravel helper functions to specify where to save the file:
Example:
$save_path = base_path('uploads');
You can use the Laravel File
Class to make sure the path exists with:
File::makeDirectory($save_path, $mode = 0755, true, true);
You will need to add use File;
in the top of the file with all the class includes.
Later, to access said files you can make a View Composer which you can add logic to in order to limit who can view the file.
Upvotes: 3