Hello All,

I'm trying to do a simple upload, and what I put together "was" working (honest ;-), but now for some reason I get the following error:

Warning: fopen("", "r") - Inappropriate ioctl for device in /home/jennides/www/php/upload.php on line 5

Warning: stat failed for (errno=2 - No such file or directory) in /home/jennides/www/php/upload.php on line 5

Warning: fread(): supplied argument is not a valid File-Handle resource in /home/jennides/www/php/upload.php on line 5

I'm not sure what or why this is happening. Here's the code that I'm using:

<?php

if ($_POST['submit']) {

$data = addslashes(fread(fopen($image_file, "r"), filesize($image_file)));

}
else {

?>
<FORM ENCTYPE="multipart/form-data" ACTION="<?php echo $PHP_SELF; ?>" METHOD=POST>
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="20000">
<INPUT NAME="image_file" TYPE="file" size="50">
<INPUT TYPE="submit" name="submit" VALUE="Upload">
</FORM>
<? 

}

?>

Any insight would be greatly appreciated!

JeNNiDeS

    I still don't what caused the problem, but I started over at the beginning and now it's working again.

    Hmmmmmmmmmm....

    Thanks anyways

      Write a Reply...