04 October 2017

Output or Force Download MP3 with PHP

The two code snippets presented in this page can be used to output audio MP3 files, or to force the Download, with PHP
 data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxAREhIQDxAPDw4QEBAQDg4PDw8NDQ4OFREWFhURFRYYHSgsGBomGxUVITEhJSkrLy4uFx8zODMvNygxLisBCgoKDg0OGxAQGi0dIB8uLS0tLS8tLSsrLystLy0tLSstLS0uKy0rLS0rLS0tLS0tLSsrLS0tLSstLS0tKystK//AABEIAOAA4QMBEQACEQEDEQH/xAAcAAACAgMBAQAAAAAAAAAAAAAABgMFAgQHCAH/xABQEAABAwICAgwLBAkBBQkAAAABAAIDBBEFBhIhEzEzQVFhcXJzsbPBByIjJDI0UnSBkbIUNYKhFRZCVGKSlNHSU0NEg6LwJWNkhJOjwuHx/8QAGgEBAAIDAQAAAAAAAAAAAAAAAAQFAQMGAv/EADYRAAIBAgIGCAYCAgMBAAAAAAABAgMRBBIFITEycYEUIiMzQVGxwRNhkaHR8CRSFeE0QvFy/9oADAMBAAIRAxEAPwDuKAEAIAQAgBACAEAIDF7rICsq8ZjZtuCA1P1mh9ofNAZMzJEf2h80BaUta1+0boDaQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIDlefvCJNDUPpaRsYENmyyyNLy6QgEhouLAXtr2z+cWrXcZWiX2B0VTq0lUqt69iRzrEc0VUpu97fwjR71q6RMm/4fDfP6lf8ApWb2z806RMx/iMN8/qRux+aNzbvJBPDtFSaNXPt2lPpHArDSTi7xf2OueDrGnSgXN1uK06fGdSAyQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQAgBACAEB5xz594VnvDuoKuq77OywL/AI0OAsyLWSrkaGLmjif7HO7lJw21lLpp9nHj7HWvBTvKYc8dph2ggMroAugPt0AIAQAgBACAEAIAQAgBACAEAIAQAgBACAEAIAQHnHPf3hW+8O6gq6rvs6/Av+PDgLMi1kq5Ghi5o4n+xzu5SsNtZTaY3I8fY6z4K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Qr1I6kyiGZpBtwNv+Id6jvR1Pwb+34Nqxk/JEUmN1cvixRsjvvtYXO/5iepe46Porbd/vyPLxdR/IdPB1k+Z8onm0nOJBLnXJKmRioqyVkR223dnfKSHQaGjeCyYJkAIAQAgBACAEAIAQAgBAaOJYayYaLxcICopsn07HaQYL8iAYYYw0ADaCAkQAgNWvomyt0XC4KAomZNpg7SDBfb2kBfwUrWN0RtICmr8qQSu0nNBPIgNvCsDip/QaAgLZACAxe24sUBQYnlOnmJLmC54kBRyeDemJvoj5IDcoMhU0ZvoD5IBno6FkQsxoCA2kAIAQAgBACAEAID//2Q==

Force Download MP3 file with PHP

  • $mp3 ='path_to/mp3_file.mp3';
    if(file_exists($mp3)) {
      header('Content-Type: audio/mpeg');
      header('Content-Disposition: attachment; filename="mp3_file.mp3"');
      header('Content-length: '. filesize($mp3));
      header('Cache-Control: no-cache');
      header('Content-Transfer-Encoding: chunked'); 
      readfile($mp3);
      exit;
    }
    

Output MP3 with PHP

  • $mp3 ='path_to/mp3_file.mp3';
    if(file_exists($mp3)) {
      header('Content-Type: audio/mpeg');
      header('Content-Disposition: inline; filename="mp3_file.mp3"');
      header('Content-length: '. filesize($mp3));
      header('Cache-Control: no-cache');
      header('Content-Transfer-Encoding: chunked'); 
      readfile($mp3);
      exit;
    } 
     
     
     

Start typing and press Enter to search