I am trying to upload an image to discord that is on my hdd. Discord is giving me this error: Error opening directory '/media': Permission denied when trying to navigate to the image. How do I give discord access?
3 Answers
I had the same problem while using Discord installed via snap (By default, every application installed from Ubuntu Software is running from /snap, I think.) The solution was simple.
Open the Ubuntu Software and search for Discord. If you can see it installed here, there should be three options: Run, Uninstall and Permissions. Click permissions and make sure that read/write on removable media is turned on.
Personally, the easiest way doesn't use snap or terminal.
Settings > Applications > Discord > Read/Write on removable storage.
I used it after looking at this. I remembered there was a permissions portion to the settings app.
I'm running Ubuntu 20.04.2 LTS.
You can try to change the owner or the permissions over the directory that causes the error:
For changing owner:
chown -R new-owner:owner-group directory -> chown -R sam:sam media
For changing permissions:
chmod -R 754 directory -> chmod -R 754 media
If these commands don't work, try executing your application with sudo, it should have permissions in that mode.
Hope this helps, good luck!