0

I have php code for simple file uploadings.
I have index.php with form

<form action="upload.php" method="post" ENCTYPE="multipart/from-data">
Choose file <input type="file" name="userfile" size="50"> <input type="submit" value="Upload">
</form>

and upload.php

<?php
$uploaddir = '/var/www/htdocs/upload/data/'
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);  *

if(is_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) { *
  echo "file uploaded.";
} else {
  echo "upload unsuccessful!";
}

?>

It works. But it works only on konquerror. But not on firefox, MS IE or opera.

In apache log I get PHP Notice: Undefined index: userfile. in lines marked with *.

2
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by slacke
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.