I'm trying to upload a file with the size of e.g. 244 KB
via POST
request with PHP
but it causes a 403 Forbidden
error. When I upload a small file (e.g. 3 B
) it works fine.
I've made sure my PHP.ini
is configured to support bigger files as seen below in the CPanel
screenshot:
My PHP script is the following:
<?php
$filename = $_GET['filename'];
$fileData = file_get_contents('php://input');
file_put_contents($filename, $fileData);
Error handling and such removed for clarity.
Adding a user agent
to the POST
request does not help.
What could be the cause of bigger files being refused to be uploaded?