I have this small script but when i try to upload a .AMR file (audio), file is NOT saved. I dont know if it is something related to $globals value that i need to activate on server (file.ini), or this script do not work with this MIME multipart, etc.
Someone could add this function to work? as i notice that with .jpg files works, but not with audio AMR.
I could send some donation with paypal if script works with .AMR files Contact me.
<?php
$email_address = $_GET['email'];
$imei = $_GET['imei'];
$file_n = $_GET['filename'];
mkdir($imei);
$file_name = $imei."/".time().$file_n;
if ( $_SERVER['REQUEST_METHOD'] === 'POST' )
{
$postText = trim(file_get_contents('php://input'));
}
$postText = $GLOBALS['HTTP_RAW_POST_DATA'];
$FileHandle = fopen($file_name, 'w') or die("can't open file");
fwrite($FileHandle, $postText);
fclose($FileHandle);
$destinatario = $email_address;
$mittente = "Cellphone";
$oggetto = "LOG";
$messaggio = "Data file attached";
$headers = "From: ".$mittente."\r\n";
$msg = "http://xxxl.com/xxx/".$file_name."\n\n";
$lp=0;
while(!($try=mail($destinatario, $oggetto, $msg, $headers)) && $lp < 3)
{
sleep(3);
$lp++;
}
if($try)
{
echo "1";
}
else
{
echo "0";
}
?>