Should Laravel define the uploaded file directory in storage instead of public?
给我你的怀抱
给我你的怀抱 2017-06-30 10:00:09
0
2
905

And public is set to non-writable to be safe
How harmful is uploading files to publi to the system?

给我你的怀抱
给我你的怀抱

reply all(2)
巴扎黑

I agree with @chekun’s answer, please read the official document carefully: File Storage

Public disk# "Public disk" means that your files will be publicly accessible. By default, the public disk uses the local driver and stores the files in the
storage/app/public directory. For network access, you need to create a symbolic link from public/storage to
storage/app/public. This convention allows your publicly accessible files to stay in the same directory, so they can be easily shared between different deployment systems, such as
Envoyer's "non-stop" deployment system.

You can create symbolic links using the storage:link Artisan command:

php artisan storage:link Of course, once the file is placed and the symbolic link is created, you can create the URL using the asset helper function:

echo asset('storage/file.txt');

洪涛

laravel default is:

The public storage directory in the storage configuration is storage/app/public
Then use php artisan storage:link link to the public directory

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template