Set File Permissions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Set File Permissions

Post by AliasBDI »

I created a form that uploads files from one domain to another. But my problem is that the file which is uploaded has the permission of the first domain. So people surfing the uploaded file on its domain cannot view it (the permissions are set for the first domain with the form). So I figured that after uploading the file, php would set the permissions of that file for that specific domain that it exists on.

Can PHP set permissions to files?
AliasBDI
Forum Contributor
Posts: 286
Joined: Fri Nov 15, 2002 10:35 am
Location: Spring, TX, USA

Post by AliasBDI »

To clear it up... I need to set the NTFS permissions. Is that possible?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]chmod[/php_man] may set NTFS perms, but not sure..
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

AliasBDI wrote:Is that possible?
AFAIK php does not know anything about ntfs permissions but, fortunately, it can run external programs. So you can run some command line utility similar to chmod on Unices... as well as .wsf file ;) Here is what quick google search revealed: http://66.102.9.104/search?q=cache:VI81 ... sion&hl=en

Seems it fits for your task :D
Post Reply