Re: is_uploaded_file
| From: | Paul Roberts | Date: | Fri, 28 Dec 2001 15:30:15 +0000 |
| Subject: | Re: is_uploaded_file | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-78948@lists.php.net to get a copy of this message | ||
yep it all works on my dev server but the host only has 4.02 installed these
functions are php 4.03+
----- Original Message -----
From: "Andrey Hristov" <ahristov@icygen.com>
To: "Paul Roberts" <roberts_paul@bigfoot.com>
Cc: <php-general@lists.php.net>
Sent: Friday, December 28, 2001 3:26 PM
Subject: Re: [PHP] is_uploaded_file
> From : http://www.php.net/manual/en/features.file-upload.php
> <?php
> /* Userland test for uploaded file. */
> function is_uploaded_file($filename) {
> if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
> $tmp_file = dirname(tempnam('', ''));
> }
> $tmp_file .= '/' . basename($filename);
> /* User might have trailing slash in php.ini... */
> return (ereg_replace('/+', '/', $tmp_file) == $filename);
> } if (is_uploaded_file($userfile)) {
> copy($userfile, "/place/to/put/uploaded/file");
> } else {
> echo "Possible file upload attack: filename '$userfile'.";
> }
> ?>
>
> HTH
>
> Regards,
> Andrey Hristov
>
> ----- Original Message -----
> From: "Paul Roberts" <roberts_paul@bigfoot.com>
> To: "Andrey Hristov" <ahristov@icygen.com>
> Cc: <php-general@lists.php.net>
> Sent: Friday, December 28, 2001 5:13 PM
> Subject: Re: [PHP] is_uploaded_file
>
>
> > no it's move_uploaded_file and it's 4.03 or greater as well.
> >
> > i'm using empty() as i just want to see if i uploaded a file or not
> >
> >
> > Paul Roberts
> > roberts_paul@bigfoot.com
> > ++++++++++++++++++++++++
> > ----- Original Message -----
> > From: "Andrey Hristov" <ahristov@icygen.com>
> > To: "Paul Roberts" <roberts_paul@bigfoot.com>
> > Cc: <php-general@lists.php.net>
> > Sent: Friday, December 28, 2001 12:48 PM
> > Subject: Re: [PHP] is_uploaded_file
> >
> >
> > > Read the docs about copy_uploaded_file() (this is the function with
some
> > more docs, as I remember).
> > >
> > >
> > > HTH
> > >
> > > Andrey Hristov
> > > ----- Original Message -----
> > > From: "Paul Roberts" <roberts_paul@bigfoot.com>
> > > To: <php-general@lists.php.net>
> > > Sent: Friday, December 28, 2001 2:41 PM
> > > Subject: [PHP] is_uploaded_file
> > >
> > >
> > > > I'm on PHP/4.0.2
> > > >
> > > > i'm getting
> > > > Fatal error: Call to undefined function: is_uploaded_file()
> > > >
> > > > how can i emulate the function
> > > >
> > > > will also nag my host but...
> > > >
> > > >
> > > > Paul Roberts
> > > > roberts_paul@bigfoot.com
> > > > ++++++++++++++++++++++++
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > > For additional commands, e-mail: php-general-help@lists.php.net
> > > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > > For additional commands, e-mail: php-general-help@lists.php.net
> > > To contact the list administrators, e-mail:
php-list-admin@lists.php.net
> > >
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
>