Re: Re: Upload problem - final size is different

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 9, 2007 9:15 am, Eric Trahan wrote:
> After some other tests, I think the problem is with the rights of the
> file.
>
> I made tests on my personnal Mac that runs Apache/1.3.33 (Darwin) PHP/
> 4.4.4.
>
> Settings in PHP:
> file_uploads: On
> upload_tmp_dir: no value (so it uploads in /var/tmp/)
> upload_max_filesize: 2M
>
>
> My destination folder is page5, same as my server (everyone can read
> and write).  But when the files are droped in that folder, with the
> move_uploaded_file function, the owner is www and group is wheel.  So
> I can't open it...  But when I change the rights on the file, I can
> the see the images.
>
> Is there a way to change the owner or the group of a file in PHP.

There probably is a http://php.net/chown, but unless you are running
Apache as 'root' (DON'T DO THAT!) then it won't work.

However, you can use http://php.net/chmod to make the file readable by
you as well as the 'www' user.

It is very frightening, however, to see the group 'wheel' on the file,
since 'wheel' is usually reserved for users that can 'su' to root, and
having uploaded image files in that group just doesn't feel right.

-- 
Some people have a "gift" link here.
Know what I want?
I want you to buy a CD from some indie artist.
http://cdbaby.com/browse/from/lynch
Yeah, I get a buck. So?

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux