Hello php-general,

  Right now I am trying to create a form that upload the file.
  The form it self:

  <form name="forms2" action="upload.php" method="post" enctype="multipart/form-data">
        <input type="hidden" name="MAX_FILE_SIZE" value="64000">
        <input name="image" type="file">
        <input type="submit" name="submit">
  </form>

  and the upload.php itself contain the code that I took from chapter
  18 of php manual:

  <?php

        $uploaddir = 'C:/Program Files/Apache Group/Apache2/htdocs/test/' ;
        $uploadfile = $uploaddir . $_FILES['userfile']['name'];
        
        print "<pre>";
        if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
                print "File is valid, and was successfully uploaded. ";
                print "Here's some more debugging info:\n";
                print_r($_FILES);
        } else {
                print "Possible file upload attack!  Here's some debugging info:\n";
                print_r($_FILES);
        }
        print "</pre>" ; 
  ?>


But, I always got:

Possible file upload attack!  Here's some debugging info:
Array
(
    [image] => Array
        (
            [name] => templates.txt
            [type] => text/plain
            [tmp_name] => C:\WINDOWS\TEMP\php471.tmp
            [error] => 0
            [size] => 2048
        )

)  

and when I look up at C:/Program Files/Apache
Group/Apache2/htdocs/test/ (the target directory) ..  I never found
the file that I uploaded ...

can someone tell me y this happen ?

thank you

--
Best regards,
 adwinwijaya                          mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to