Ask coding questions

← Back to all posts
Permissions not working when uploading
h
epicseg (3)

“File upload failed, ensure permissions are writeable on the directory (777)”
I am trying to host my image host on repl, and I’m getting that error! Can someone please tell me how to fix it. Thx

Comments
hotnewtop
epicseg (3)

so technically how do i enable write permissions

19wintersp (1121)

@epicseg If you run ls -l in the Shell of the repl, you should get a list of files and directories. The leftmost column should be a mix of letters and dashes; those show the permissions.

epicseg (3)

@19wintersp Ok so i just checked it, and.. img folders permissions are: drwxrwxrwx 1 runner runner 66 Mar 1 23:24 img
wth??

19wintersp (1121)

@epicseg drwxrwxrwx means 777; you have the permissions required. Are you sure you're referencing the current directory, and that the file you're requesting exists? From your logs, it looks like you're trying to read "img/.png".

LukeWright (114)

can you post a screenshot?

epicseg (3)

@LukeWright Well, its an image host. When I upload it, and when it auto copies to my clipboard, it says that error. I need permissions to write for my folder named: img. How would i enable permissions for that?

19wintersp (1121)

@epicseg Does the folder exist, and where is it?

epicseg (3)

@19wintersp the folder does exist, and it should be /img. I named it img.

19wintersp (1121)

@epicseg "/img", as in, in the root directory?

19wintersp (1121)

@epicseg From looking at your code ("Imagehisttest"), it looks like the "img" folder should be on the same level as the other PHP files, not inside the "imgserver" folder.

epicseg (3)

@19wintersp Um, no thats not the source. Here, i made it public: https://repl.it/@epicseg/host

Mrflimblma5569 (0)

yo i can help you make a image hosting site
@epicseg

epicseg (3)

[email protected]
comment ur discord so i can add you

epicseg (3)

heres my discord @Mrflimblma5569
syn#1811
send me a friend request