Files uploaded through a form

Files uploaded through a form

am 08.10.2006 06:12:27 von Ron Piggott

--=-wtkpym1n4QrPEEGShimP
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

The way my web hosting server was configured is that files uploaded
through a web form to be processed by PHP are owned by 'www'. I am
wondering if I am able to change the owner of the file to my ftp user
name before I use the move_uploaded_file command to the directory I need
the file to move to.

I am also wondering what the IF syntax is to see if the file upload was
successful. Somehow I would like to know if

move_uploaded_file( $userfile , $destination_file_name);

worked successfully before I update my table.

Ron

--=-wtkpym1n4QrPEEGShimP--

Re: Files uploaded through a form

am 09.10.2006 07:40:14 von Chris

Ron Piggott (PHP) wrote:
> The way my web hosting server was configured is that files uploaded
> through a web form to be processed by PHP are owned by 'www'. I am
> wondering if I am able to change the owner of the file to my ftp user
> name before I use the move_uploaded_file command to the directory I need
> the file to move to.

No. Only the 'root' user on the server can change file ownership.

> I am also wondering what the IF syntax is to see if the file upload was
> successful. Somehow I would like to know if
>
> move_uploaded_file( $userfile , $destination_file_name);

RTFM:
http://php.net/move_uploaded_file

If filename is not a valid upload file, then no action will occur, and
move_uploaded_file() will return FALSE.

If filename is a valid upload file, but cannot be moved for some reason,
no action will occur, and move_uploaded_file() will return FALSE.
Additionally, a warning will be issued.

--
Postgresql & php tutorials
http://www.designmagick.com/

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