lara68236's avatar

Public Storage

I'm in my development environment. I have set the artisan storage:link When I upload a file I do it like this:

$file->storeAs($path, $file_name, 'public');

When I look in finder (Mac) at '/storage/app/public' I see the created directory and all its content.

But, when I look at '/public/storage/' it does not show the same thing.

I cannot seem to access the stored files using storage_path() or public_path(). No matter what I do the end result is that the system can't find the file.

I am creating a DAM (Digital Asset Manager), so I must be able to read these files after saving them to disk so thatI can place content into DB for searching.

Thanks in advance for your help.

0 likes
2 replies
lara68236's avatar

This is the only way I can get it to work

file_get_contents(public_path($path_to_stored_file));

mecjos's avatar

if you will use public_path(), it must contain storage/ .. for example, your public path is storage/app/public/images/..... you can use public_path(storage/images/image.png)

Please or to participate in this conversation.