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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

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.