Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Uploaded files & permissions

Status
Not open for further replies.

danomac

IS-IT--Management
Joined
Aug 2, 2002
Messages
731
Location
AM
I have been browsing through PHP.net but have not found any reference to what permissions PHP uses to create files.

Is there any way to tell move_uploaded_file() to use different permissions when creating the file?

D
 
move_uploaded_file() merely safely moves a file from the temporary directory to another place on the filesystem. It cannot change permissions.

You can change permissions on file using PHP, either through the chown(), chgrp() and chmod() functions or by externally invoking filesystem-specific functions using exec() or the backtick operator.

There are a number of limits, depending on your OS and PHP configuration.

Want the best answers? Ask the best questions!

TANSTAAFL!!
 
In that case, it's a good thing I have shell access.

Would using umask() prior to calling move_uploaded_file() have a desired effect? I was still looking around on PHP's site when I found umask(), and it seems to reset after a command is used.

I'll have to try this later to see if it gives me a desired result.

Thx for the speedy reply.

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top