Reply to Re: [PHP] Permissions on uploaded image don't allow for over writing

Your name:

Reply:


Posted by John Hicks on 01/30/05 01:23

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

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация