News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

question about uploads

Started by Gandalf, November 26, 2004, 06:12:10 AM

Previous topic - Next topic

Gandalf

hello everyone, it's me again to bother you ;D
i have a simple question, why everytime somebody upload an attachment the attachment is in chmod 644 and not 666 or 777 ???
BTW my hosting haven't a value for upload_tmp_dir
see the phpinfo here if it helps
Siemens-mobiles.org Visit it and you won't regret it :D

EG

because thats the default

why would it need to be anything other than 644 ???

the attachment directory needs to be 777, but the attachment doesnt surely ???

Gandalf

because when i try to unlink from the forum (modify post and uncheck the uploaded file checkbox) the file will no more be in the post but he's always on the system and if i check the forum log error there's an error cannot unlik the file ..... permission denied
Siemens-mobiles.org Visit it and you won't regret it :D

[Unknown]

Hmm... ability to delete is determined by ownership, though, isn't it?

-[Unknown]

Gandalf

a question about the code
when you make a copy(sorce, destination)
do you do a chmod("777"); or not?
Siemens-mobiles.org Visit it and you won't regret it :D

[Unknown]

If you copy a file (with copy) it will keep whatever chmod it had before being copied.  To change that, it has to be manually chmod'd.

-[Unknown]

Gandalf

yes i know
i've found this in the Sources/Post.php

// Attempt to chmod it.
@chmod($destName, 0644);

it must be replaced with

// Attempt to chmod it.
@chmod($destName, 077);

to let the files be delete later
Siemens-mobiles.org Visit it and you won't regret it :D

Gandalf

when i've change it to "0777" then the upload,delete works fine
BTW i'm not the owner of the files but i'm in the group so it must be set at least "666"
Siemens-mobiles.org Visit it and you won't regret it :D

Advertisement: