Simple Machines Community Forum

SMF Support => SMF 1.1.x Support => Topic started by: Gandalf on November 26, 2004, 06:12:10 AM

Title: question about uploads
Post by: Gandalf on November 26, 2004, 06:12:10 AM
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 (http://www.siemens-mobiles.org/php.php) if it helps
Title: Re: question about uploads
Post by: EG on November 26, 2004, 07:16:40 AM
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 ???
Title: Re: question about uploads
Post by: Gandalf on November 26, 2004, 07:25:11 AM
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
Title: Re: question about uploads
Post by: [Unknown] on November 26, 2004, 08:48:52 PM
Hmm... ability to delete is determined by ownership, though, isn't it?

-[Unknown]
Title: Re: question about uploads
Post by: Gandalf on November 27, 2004, 04:59:49 AM
a question about the code
when you make a copy(sorce, destination)
do you do a chmod("777"); or not?
Title: Re: question about uploads
Post by: [Unknown] on November 27, 2004, 05:05:36 AM
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]
Title: Re: question about uploads
Post by: Gandalf on November 27, 2004, 05:10:19 AM
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
Title: Re: question about uploads
Post by: Gandalf on November 27, 2004, 05:38:45 AM
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"