P
P
Pavel2020-02-11 17:40:38
Laravel
Pavel, 2020-02-11 17:40:38

Error when adding image by public_path?

Hello!

When adding an image, specify the path

$image_path = public_path('images/'.$site_id.'/'.$new_name);
$ImageUpload->save($image_path);

- it works, it adds a picture,

but if I want to make a division, nesting
$image_path = public_path('images/'.$site_id.'/section/original/'.$new_name);
$ImageUpload->save($image_path);

gives 500 error

As I understand it, he does not want to automatically create folders, how can this be fixed?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri Kulaxyz, 2020-02-12
@yatort

Check the logs. Most likely a problem with the rights of the Storage folder

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question