Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5992727
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:34:27+00:00 2026-05-22T23:34:27+00:00

I have the following code header(Content-Description: File Transfer); header(‘Content-Type: audio/mp3’); header(Content-Disposition: attachment; filename= .

  • 0

I have the following code

        header("Content-Description: File Transfer");
        header('Content-Type: audio/mp3');
        header("Content-Disposition: attachment; filename=" . $arrResults['audioLink'] . ".mp3");
        header('Expires: 0');
        header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
        header('Pragma: public');
        header("Content-Transfer-Encoding: binary");

        $strLink = 'http://ag-org.s3.amazonaws.com/members/tele_classes/' . $arrResults['audioLink'];

        ob_clean();
        flush();
        readfile($strLink);

However when the download link is clicked that executes this code it always returns a 0 byte file. All files are set to public in the bucket.

What am I doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T23:34:28+00:00Added an answer on May 22, 2026 at 11:34 pm

    Is the .mp3 extension really not part of the filename as it’s stored on S3?

    You’re appending .mp3 to the filename in the Content-Disposition header, but not the URL you’re passing to readfile.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code <html> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8 /> <title>Untitled Document</title>
I have the following in my .php file. Just trying a simple search on
I have created the following code as part of an excercise in a Ruby
I have the following CSS: html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td { background: transparent; border: 0; font-size: 100%; margin:
I have Objective C code creating an NSUrlConnection as follows: //prepar request NSString *urlString
I have a global.php file that I call from the top of every script.
I'm having some problems with a weird HTTP status code in MSIE8. I send
im trying to edit a field using code instead of the wizard. im not
I'm been stuck on this problem for a while and I'm pretty sure it

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.