mathishuettl's avatar

[Filesystem] failed to open stream: Permission denied

Hello,

i work the first time with laravel filesystem. My users need to upload images. Everybody should be able to watch this image. So i set the following in config/filesystem.php

'default' => env('FILESYSTEM_DRIVER', 'public'),

And for the upload I have this code:

$request->file("file")->store("uploads");

but i get a permission error.

OS: Windows 10 Webserver: Laragon

0 likes
3 replies
mathishuettl's avatar

i searched the forum and red the description but i still not working this is why i'm asking this question

jlrdw's avatar

Did you scroll down in the documentation and read this part

If you do not want a file name to be automatically generated, you may use the storeAs method, which accepts the path, file name, and disk name as its arguments:

$path = $request->photo->storeAs('images', 'filename.jpg');

$path = $request->photo->storeAs('images', 'filename.jpg', 's3');

You really need to dig into the docs.

Please or to participate in this conversation.