Jump to content

Does php.ini support upload permissions?


tami

Recommended Posts

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! :)
Link to comment
Share on other sites

I don't think you can do this with the php.ini nor the httpd.conf file. You [i]may[/i] 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.
Link to comment
Share on other sites

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.
Link to comment
Share on other sites

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".
Link to comment
Share on other sites

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 [b]when uploading via the ProFTPD server[/b], 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. :)
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.