Jump to content


Photo

Does php.ini support upload permissions?


  • Please log in to reply
4 replies to this topic

#1 tami

tami
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 May 2006 - 03:54 PM

Hi,

I am having a difficult time finding the solution to this, and as far as I can tell, it's not even implemented -- this is where I think I am wrong.

I am trying to set the default permissions from file uploads through php files to 666 (I think), rather than 644 (as I believe the default setting is at the present).

The only related directive in php.ini that I can see is:
file_uploads = On

Where can I set the default upload permissions for php-uploaded files? I can't find this on httpd.conf and I certainly do not see any functionality with php.ini.

Thanks in advance! :)

#2 Kris

Kris
  • Staff Alumni
  • Advanced Member
  • 2,755 posts
  • LocationThe Internet

Posted 05 May 2006 - 04:01 PM

I don't think you can do this with the php.ini nor the httpd.conf file. You may be able to do it with a .htaccess but I don't know.

One solution may be to change the permissions on the files straight after the upload with the chmod() function.

#3 tami

tami
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 May 2006 - 04:21 PM

SemiApocalyptic:

Thanks for your reply. The issue is that I have many domains to maintain and it would be a continuous battle to chmod the files -- and then having to deal with changing the permissions once again (I've noticed that the behavior of permissions is not stable).

That is why I am looking for universal support for such an issue -- but it seems that it is missing.

If anyone does know how to do this -- if it's possible, I'd love to hear how.

Thanks.

#4 ober

ober
  • Staff Alumni
  • Advanced Member
  • 5,337 posts
  • LocationEast Coast, USA

Posted 05 May 2006 - 06:07 PM

I don't understand how chmodding would be an issue for you at all. You wouldn't have to do it manually... you can use PHP to chmod the files after they're uploaded.

And I have to disagree with your statement that "the behavior of permissions is not stable".

Info: PHP Manual


#5 tami

tami
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 05 May 2006 - 06:51 PM

ober:

Perhaps I should have been more clearer. I guess I was comparing apples to oranges, since the behavior of the permissions is not stable when uploading via the ProFTPD server, but I guess it's not the same via the creation of PHP files through scripts.

Let me add that I'm not a PHP programmer; I am an admin on the server. I see what you are suggesting regarding implementation but unfortunately I will not know how to do it myself, so I'll try to ask someone who knows better how do this.

Thanks. :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users