Upload File Remote Server with PHP

Hello everyone, I have a question.
Previously uploaded a .CSV file to a server with php using the POST method (in kodular) and GET on the server with php, I tried granting read permissions but it doesn’t work for me, do you know any other way to upload the file?
I share with you how I used it previously.
PHP

if($_GET[‘p’]==$ACCESSKEY){
$data = file_get_contents(‘php://input’);
$filename = $_GET[‘filename’];
if (file_put_contents($filename,$data)) {
if (filesize($filename) != 0) {
echo “Transferencia completada.”;

KODULAR
datospagokodular