php-general | 2001122
Date: 12/28/01
- Next message: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Previous message: Paul Roberts: "Re: [PHP] is_uploaded_file"
- In reply to: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Next in thread: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Reply: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>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 <email protected>>
To: "Andrey Hristov" <ahristov <email protected>>
Cc: <php-general <email protected>>
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 <email protected>
> ++++++++++++++++++++++++
> ----- Original Message -----
> From: "Andrey Hristov" <ahristov <email protected>>
> To: "Paul Roberts" <roberts_paul <email protected>>
> Cc: <php-general <email protected>>
> 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 <email protected>>
> > To: <php-general <email protected>>
> > 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 <email protected>
> > > ++++++++++++++++++++++++
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> > > For additional commands, e-mail: php-general-help <email protected>
> > > To contact the list administrators, e-mail: php-list-admin <email protected>
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> > For additional commands, e-mail: php-general-help <email protected>
> > To contact the list administrators, e-mail: php-list-admin <email protected>
> >
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe <email protected>
> For additional commands, e-mail: php-general-help <email protected>
> To contact the list administrators, e-mail: php-list-admin <email protected>
>
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Previous message: Paul Roberts: "Re: [PHP] is_uploaded_file"
- In reply to: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Next in thread: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Reply: Paul Roberts: "Re: [PHP] is_uploaded_file"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

