R
R
rsitnikov752019-04-17 19:16:42
Laravel
rsitnikov75, 2019-04-17 19:16:42

How to specify folder when uploading files in Laravel?

Good evening. I am trying to upload an image in laravel

path = $request->file('file')->store('uploads','public');

Now it saves in storage, but I need pictures to be uploaded to public/myfiles
What should I write in filesystems.php and how can I change the line that I indicated above?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konata Izumi, 2019-04-18
@rsitnikov75

It is not recommended to upload directly to public.
You should make a symbolic link from storage to public.
Accordingly, save in the same storage, but the files will be available through a symbolic link.
This is all described in detail in the storage documentation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question