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

  • Home
  • SEARCH
  • 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 3228688
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T16:43:21+00:00 2026-05-17T16:43:21+00:00

hello there i am constructing a site where i can upload my own mp3

  • 0

hello there i am constructing a site where i can upload my own mp3 files.
So i have the file uploaded to the server and when i link to it the browser plays the song.
Is it possible to make it so when the link is press it downloads the file instead of playing it.

For example http://www.example.com/music/song.mp3 once clicked it downloads instead of playing.

Maybe this could be done in JavaScript?

Thanks so much.

  • 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-17T16:43:22+00:00Added an answer on May 17, 2026 at 4:43 pm

    You need to set the correct header for your mp3 files. You can do that in your web server’s configuration, or you can make a “download” script that will send the correct header, and the contents of the mp3 file

    If you ware using PHP, for instance, you could do something like this (from the PHP manual):

    <?php
    // We'll be outputting a PDF
    header('Content-type: audio/mpeg');
    
    // It will be called file.mp3
    header('Content-Disposition: attachment; filename="file.mp3"');
    
    // The PDF source is in original.mp3
    readfile('original.mp3');
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

hello there okay so this is the deal i have my mp3 files on
Hello there I have a issue related to the usage of the bitmap enabled
Why hello there Stackoverflow, I have a nutcracker for ya, is there an good
Hello there okay so this is the deal i have a folder where my
Hello there and Merry Christmas !!! I am new to WPF and I am
Is there the equivalent of the Hello World program for GIS applications? I am
Hullo all, Wondering if there are any Java hackers who can clue me in
Hello I have the following error by git-fsck, which cannot be cleaned by git-gc
Hello can anybody solve this please I'm creating the object in the action class
Hello there fellow Stackers! I wonder if anybody could tell me what the following

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.