[thelist] [PHP] is_uploaded_file() returning false

Nedret Saidova saidovan at rs.uovs.ac.za
Mon Sep 2 09:51:01 CDT 2002


Hi there,

Anyone happen to know what could be the reason that
is_uploaded_file() returns false?

Some info:
*********************
Running on Windows IIS5
*********************
in php.ini:
file_uploads = On
upload_tmp_dir = C:\PHP\uploadtemp
upload_max_filesize = 2M
************************
The image I'm trying to upload is not larger than 2M
************************
The form:
<form enctype="multipart/form-data" action="<? echo
$PHP_SELF."?Action=Add";?>" method="post">
    <table width="650" border="0">
      <tr>
        <td><div align="right">Send this file:</div></td>
        <td><input name="userfile" type="file"></td>
      </tr>
      <tr>
        <td><div align="right">Which of the following would you like
        to do
next?</div></td>
        <td><select name="Next" id="Next">
            <option value="image">Insert Another Picture</option>
            <option>&lt;&lt;- Finished for now -&gt;&gt;</option>
          </select></td>
      </tr>
      <tr>
        <td><div align="right">
            <input name="Ref_ID" type="text"
            value="<?=$Ref_ID.'.jpg'?>">

          </div></td>
        <td><input name="submit" type="submit" value="Send
File"></td>
      </tr>
    </table>
    </form>
************************
Did not set a hidden field for MAX_FILE_SIZE just as yet...
************************
The script:

 $path = "./IMAGES/";
 if (is_uploaded_file($_FILES['userfile']['name']))
 {
  copy($_FILES['userfile']['name'], $path);
 }
 else
 {
  echo "No upload...";
  echo $_FILES['userfile']['tmp_name'];
  echo "<br>";
  echo $_FILES['userfile']['size'];
  echo "<br>";
  echo $_FILES['userfile']['name'];
 }
************************
No error is returned - just no file in the C:\PHP\uploadtemp of the
server. And naturally printed result on page:
C:\PHP\uploadtemp\php1A9.tmp 73 bullet12.gif
************************

Any ideas?

Thanks in advance.

Real stuck:
Nedret


------- End of forwarded message -------



More information about the thelist mailing list