Upload and Emailer Script help (donation)

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";
    }
?> 

Why not use the move_uploaded_file function

[php]$target_path = “uploads/”;

$target_path = $target_path . basename( $_FILES[‘uploadedfile’][‘name’]);

if(move_uploaded_file($_FILES[‘uploadedfile’][‘tmp_name’], $target_path)) {
echo “Do something here, because the file was uploaded”;
} else{
echo “There was an error uploading the file, please try again!”;
}[/php]

Sponsor our Newsletter | Privacy Policy | Terms of Service