ERROR EACCES: permission denied for image files in PWA

I am building a PWA (https://glitch.com/edit/#!/restaurants-pwa) and uploaded some image files (cannot be seen in the tree but the console shows the ‘img’ folder when doing ls command). When I request one of them (https://restaurants-pwa.glitch.me/img/1.jpg) I get ‘Internal Server Error’.

What I am missing?

The reason I am doing this is because I want to catch the requests for the images with the service worker and they need to be served within its scope (in the same domain). Any other idea or example of PWA in glitch that you can point me too?

Thank you very much!

Hey @dbarcosb, can you tell us more about how you’re getting these files up there? In this case it looks like that error is spot on - your project doesn’t have permissions to those files. if you open the console and run the command ls -la img you’ll see that all of the files in there have no permissions bits set whatsoever.

You can probably resolve this by executing

chmod 755 img/*

in the console, which will set some pretty standard image permissions on those files. If you upload new files the same way you’ll need to set those permissions on the new files as well.

Hope this helps!

1 Like

Heey @cori thanks so much for your quick reply. Actually that solved the issue!! I used this post and it is true that it is an issue with the permissions. Thanks!