Open trunglemobiledev opened 1 year ago
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
.
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)));
Intervention\Image\Exception\NotWritableException Can't write image data to path