faqts : Computers : Programming : Languages : PHP : Common Problems : File Uploading

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

23 of 50 people (46%) answered Yes
Recently 5 of 10 people (50%) answered Yes

Entry

why do $file keeps being "none" when "$file_name" contains the right value ?

Jul 10th, 2000 07:47
Diethard Dietrich, Imran Aziz, Dave Garth, Jerome C,


It sounds like the file isn't actually being uploaded. Make sure your 
form looks like:
<form method=post action='url' enctype='multipart/form-data'>
  <input type=hidden name='MAX_FILE_SIZE' value=200000>
  file: <input type=file name='file'>
</form>
the enctype is needed for uploads
----------------------
when the file size increase the maximum size specified, $file_name 
contains the right value and $file is empty,
I had the same problem while trying to upload a .gif .The same script 
could upload a .html file.