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
https://forums.phpfreaks.com/topic/9138-does-phpini-support-upload-permissions/
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.
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.
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".
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. :)

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.