Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add image error in host #3

Open
trunglemobiledev opened this issue Apr 4, 2023 · 2 comments
Open

Add image error in host #3

trunglemobiledev opened this issue Apr 4, 2023 · 2 comments

Comments

@trunglemobiledev
Copy link

Intervention\Image\Exception\NotWritableException
Can't write image data to path

@andikatuluspangestu
Copy link

Pastikan folder images memiliki izin tulis. Anda dapat memastikan bahwa folder memiliki izin tulis dengan menjalankan perintah ls -ld namafolder di terminal. Pastikan izin pada folder tersebut adalah drwxrwxrwx. Jika tidak, Anda dapat mengubah izin dengan menjalankan perintah sudo chmod 777 namafolder.

@pxmmpd
Copy link

pxmmpd commented Jan 2, 2024

Ok so here is how i solved it, I made the directory first before storing,

Storage::disk('local')->makeDirectory('blogpost/' . $postId);
Once the folder is created i then go on to store the manipulated images like so:

$image->save(storage_path('app/blogpost/' . $postId . '/' . $imageName));
And then pushing the image to S3

$filesystem->put('blogpost/' . $postId . '/' . $imageName, file_get_contents(storage_path('app/blogpost/' . $postId . '/' . $imageName)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants