[PLUG] PHP question

Aj Lavin aj at haightmail.org
Sun May 19 04:44:28 UTC 2002


On Sat, May 18, 2002 at 09:21:09PM -0700, Matt Alexander wrote:
> OK, I put a phpinfo() at the top of my script and it shows this:
> 
> _FILES["file"] Array
> (
>     [name] => somefile.txt
> 	 [type] => text/plain
> 	 [tmp_name] => /tmp/phpQl537A
> 	 [size] => 56
> )
> 
> Soooooo...  It looks like PHP knows about the file I uploaded, but for
> some reason my script doesn't see it.  When I print the $file and
> $file_name variables, I don't get anything.  And /tmp/phpQ1537A doesn't
> exist when I look in /tmp.
> Thanks for your help.
> ~M

Did you try getting the temporary file name using:
  $tmp_file= $HTTP_POST_FILES[ 'file'][ 'tmp_name'];
?

Your form should also have a MAX_FILE_SIZE hidden variable:
<input type="hidden" name="MAX_FILE_SIZE" value="100000"/>

Value is the maximum upload file size in bytes. I have read that the
maximum maximum is 2 Megabytes.

The temporary file is automatically deleted when the script completes.

- Aj






More information about the PLUG mailing list