I have a group of files that is uploaded via FTP. Then, I run a script that is accessed through the admin section of my site. This script is supposed to look through the list of files, sort them out, and put them in appropriate directories. My FTP'ed files belong to the the user xxxadmin. Because of this, when I run my web script, I don't have permission to rename/move the file because the web script is running as the user www-data.
Can anyone help me out with a possible solution. I have considered trying to rename/move by connecting to the FTP (in my php script) and renaming/moving them in there, but would rather not have to fumble through code to make this happen. Does anyone have any other ideas or have ran into this before?
renaming/moving FTP'ed files through web page
Moderator: General Moderators
-
JustinK322
- Forum Newbie
- Posts: 9
- Joined: Fri Jul 28, 2006 1:35 pm
-
JustinK322
- Forum Newbie
- Posts: 9
- Joined: Fri Jul 28, 2006 1:35 pm
Plain answer is - you can't modify the files without the proper permissions. You'll have to either find a way to modify the files as xxxadmin or root. Unless xxxadmin is a root user, it won't be able to change ownership either. Try changing the mode of the files so that anyone can modify the files without needing to be the owner.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.