Jump to content

Permissions for files uploaded through PHP in Windows


SuperBlue

Recommended Posts

How do you change the permissions so that uploaded files can be viewed in their default apps?

 

I got a problem with a PHP upload script, where windows doesn't allow me to access the uploaded files. Its likely some NTFS crap or the like, not something I'm to happy about getting into. Requesting the file from the browser works, so that must mean Apache has the necessary permissions to read the file.

 

Do i need to set the permissions for the uploaded file from within the script, or do i need to alter a setting in Windows somewhere? I prefer the latter, because i normally only use this for development.

How do you change the permissions so that uploaded files can be viewed in their default apps?

 

I got a problem with a PHP upload script, where windows doesn't allow me to access the uploaded files. Its likely some NTFS crap or the like, not something I'm to happy about getting into. Requesting the file from the browser works, so that must mean Apache has the necessary permissions to read the file.

 

Do i need to set the permissions for the uploaded file from within the script, or do i need to alter a setting in Windows somewhere? I prefer the latter, because i normally only use this for development.

 

You dont need to do chmod on windows. Its non essiential. "where windows doesn't allow me to access the uploaded files." Are you running as administrator? Apache has it's own pseudo-permission setup, albeit it shouldn't matter.

If i check the security settings of the file, then i got the following listed.

SYSTEM

UserName/Administrator

 

Both of which have full access, the second is the user I'm logged in with, which dose have Administrator rights. If i copy the file, (which solves the problem), and look on the same settings, then i got a few more listed.

SYSTEM

UserName/AccountName

UserName/Administrator

UserName/Users

Its likely because PHP doesn't add these two by default.

 

Adding the UserName/AccountName seems to solve the problem, i would just hate to do this manually for every file i upload. What I'm looking for is to allow access by default.

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.