Level 60
Make sure you have permissions, I think that there's no images folder, try to create images folder, then try again, otherwise run chmod -R 775 public
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have a Laravel project uploaded to Heroku.
Everything works fine, except the functionality of uploading images. When I attempt to upload, it shows this,
"Forbidden You don't have permission to access /images/ on this server."
Here is how my store() function looks,
public function store(Request $request)
{
$this->validate($request, [
'filename' => 'required',
'filename.*' => 'image|mimes:jpeg,png,jpg,gif,svg|max:2048'
]);
if ($request->hasFile('filename')) {
foreach ($request->file('filename') as $image) {
$name = $image->getClientOriginalName();
$image->move(public_path() . '/images/', $name);
$data[] = $name;
}
}
return back()->with('success', 'Images uploaded successfully!');
}
Please or to participate in this conversation.