Posting a problem with a base64 encoded file

I am trying to post a hidden input to a base64 encoded image (~ 500KB) and all I get is an error

   501 Method Not Implemented

GET to /test.php not supported.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

my code

<?php error_reporting(E_ALL) ?>
<html>
<head></head>
<body>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="POST">
<input type="hidden" name="image" value="{base64 encoded image}">
<input type="submit" name="" value="OK">
</form>

<?php if($_POST) {
    echo '<pre>'.print_r($_POST, true).'</pre>';
} ?>

</body>
</html>

Ps. on localhost everything works fine.

Thanks for the help.

+3
source share
3 answers

This is probably due to security issues. Try the following:

To fix this, add it to your /etc/httpd/conf/httpd.conf inside the block that starts with (the path to the root of your Apache directory tree):

SecRuleEngine off

<Directory "/var/www/html">
    SecRuleEngine off
</Directory>

/ var / www / html is DOCUMENT_ROOT of your site. Restart / reload apache.

0
source

, , post_max_size php.ini, , ~ 500 .

0

, . - 501, - 404.

501 - , - POST. ( , ).

404 , ( ), ErrorDocument, 404-. html , $_SERVER['PHP_SELF'] URI.

, - . , POST.

0

Source: https://habr.com/ru/post/1764538/


All Articles