Re: $_FILES problem
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: $_FILES problem

From: Iced Milk Tea <wingwingwow@gmail.com>
Date: Thu Sep 08 2005 - 08:07:05 CEST

Thanks a lot for your help!

I think bcoz' I haven't moved the file so problem arise.

But why does $_FILES['userfile']['name'] is working?

Barry 寫道:

> hi
>
> don't rely on $_FILES['name']['type'] as php relies on the browser to
> supply this.
> here's a function from the contrib notes:
>
> if (!function_exists('mime_content_type')) {
> function mime_content_type($f) {
> $f = escapeshellarg($f);
> return trim( `file -bi $f` );
> }
> }
>
> have you moved the uploaded file yet?
> the path to the actual file is being kept in $_FILES['name']['tmp_name']
> so your 1st piece of code shouldn't work.
>
Received on Tue Oct 18 02:20:09 2005