Re: [PHP] Permissions on uploaded image don't allow for over writing
Jason, Hugh, John, Thanks for all your help. And thanks Hugh for sending me your FTP script. It turns out that the chmod() command was the magic bullet I was looking for. By placing chmod ($imageName, 0777) ... into the script right after it places the uploaded file in it's destination directory, it is then ready to be over written by future users. I appreciate everyone taking the time to answer my question. -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
On Sunday 30 January 2005 23:04, Dave wrote: > I'm not sure what you mean when you say "use PHP's FTP". I'm using > $HTTP_POST_FILES because the files are retrieved through a web form. What is meant by that is that after the file is uploaded, during your processing of the upload file, instead of using something like move_uploaded_file() you use php's ftp_*() functions to FTP upload that file back to the server, in the process that file will be owned by whatever ftp user account you used to perform the ftp operations. > As for the user, I would assume that it's whatever default for any > viewer coming to a web page. I have people log in using a user name and > password retrieved from a MySQL database, but I don't see how the > browser or the server would know about that. > The thing is I'm really a newbie at this Unix server and file > permission thing. I was really hoping that there was some parameter I > could set to have the uploaded file set to full access permissions, Have a look at umask() and chmod(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
John, Hugh, I'm not sure what you mean when you say "use PHP's FTP". I'm using $HTTP_POST_FILES because the files are retrieved through a web form. As for the user, I would assume that it's whatever default for any viewer coming to a web page. I have people log in using a user name and password retrieved from a MySQL database, but I don't see how the browser or the server would know about that. The thing is I'm really a newbie at this Unix server and file permission thing. I was really hoping that there was some parameter I could set to have the uploaded file set to full access permissions, as it took all the PHP scripting knowledge I had just to get it working as much as it is now. I guess what confuses me most is, if the file was uploaded from a user from the web, how is it not already on the same permission level for other users also accessing the file from the web? It seems like any user can upload and make a file that they can't touch again, and requires an administrator to get rid of. -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
Dave wrote: PHP List, The Situation: I am building a content management system where users can, among other things, upload images into a directory. The Problem: The image uploads fine, but once it's there, it can't be over written. So if a user uploads an image, and then changes his or her mind and wants to upload a new version over it, the file upload fails. What I've Tried So far: I can manually edit the file permissions using chmod and setting the files to 777. But of course that's not something I want to have to do every time someone uploads a file. I don't know enough about file permissions and settings to know how I can set these permissions at the time that someone makes the upload. The Question: How do I allow a user, who is uploading via the web, place an image on the server with permissions that allow the file to be over written? Check the permissions on the file you have uploaded. Who is the owner? Does the user running PHP have the 'w' permission? Try 'chown'ing the image directory to the user that is running PHP. -John -John -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Permissions on uploaded image don't allow for over writing
Use php's ftp commands. Hugh - Original Message - From: "Dave" <[EMAIL PROTECTED]> To: Sent: Saturday, January 29, 2005 11:11 AM Subject: [PHP] Permissions on uploaded image don't allow for over writing PHP List, The Situation: I am building a content management system where users can, among other things, upload images into a directory. The Problem: The image uploads fine, but once it's there, it can't be over written. So if a user uploads an image, and then changes his or her mind and wants to upload a new version over it, the file upload fails. What I've Tried So far: I can manually edit the file permissions using chmod and setting the files to 777. But of course that's not something I want to have to do every time someone uploads a file. I don't know enough about file permissions and settings to know how I can set these permissions at the time that someone makes the upload. The Question: How do I allow a user, who is uploading via the web, place an image on the server with permissions that allow the file to be over written? -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 1/25/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.300 / Virus Database: 265.7.4 - Release Date: 1/25/2005 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Permissions on uploaded image don't allow for over writing
PHP List, The Situation: I am building a content management system where users can, among other things, upload images into a directory. The Problem: The image uploads fine, but once it's there, it can't be over written. So if a user uploads an image, and then changes his or her mind and wants to upload a new version over it, the file upload fails. What I've Tried So far: I can manually edit the file permissions using chmod and setting the files to 777. But of course that's not something I want to have to do every time someone uploads a file. I don't know enough about file permissions and settings to know how I can set these permissions at the time that someone makes the upload. The Question: How do I allow a user, who is uploading via the web, place an image on the server with permissions that allow the file to be over written? -- Dave Gutteridge [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php