Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

synergy's avatar

You don't have permission to access /images/ on this server

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!');
}
0 likes
2 replies
Sergiu17's avatar

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

synergy's avatar

@SERGIU17 - Thank you for replying. I've decided to move to DigitalOcean and use DO Spaces for image storage and use league/flysystem-aws-s3-v3

Please or to participate in this conversation.