decode a 64 bit Encoding string

Discussion in 'PHP' started by nafisakanwal, May 31, 2012.

  1. #1
    Hy please help me for this !
    can i decode a 64 bit Encoding string to generate audio file in php ?
    thanks in advance
     
    nafisakanwal, May 31, 2012 IP
  2. tzoly

    tzoly Member

    Messages:
    8
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    31
    #2
    encoder.php
    
    <?php
    
    $mp3data = file_get_contents("/path/to/file.mp3");
                 // alternatively specify an URL, if PHP settings allow
    $base64 = base64_encode($mp3data);
    echo $base64;
    ?>
    
    
    Code (markup):
    And the make a file
    mp3.php
    
    <?php
    
    header("Content-Transfer-Encoding: binary"); 
    header("Content-Type: audio/mpeg, audio/x-mpeg, audio/x-mpeg-3, audio/mpeg3");
    header('Content-length: ' . filesize($track));
    header('Content-Disposition: filename="mp3.mp3"');
    header('X-Pad: avoid browser bug');
    Header('Cache-Control: no-cache');
    echo base64_decode("BASE 64 STRING HERE");
    exit;
    ?>
    
    Code (markup):
    This should work :)
     
    tzoly, Jun 4, 2012 IP