/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Force MP3 Download…Don’t Stream It

I am trying to come up with php code which forces someone to download the mp3’s I have listed on my website instead of streaming when the link is clicked. Also have mp4’s listed so hopefully the same code would work for both.

Please if anyone knows how to do this it would be so helpful.?

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@hastxFeb 14.2008 — if you zip the file that would force a download before it could be extracted. I think that specifying attachment as the content dispostion in the header would also force the browser to receive all the file content and prompt to save the file.

http://www.php.net/header
Copy linkTweet thisAlerts:
@robertketterauthorFeb 14.2008 — Thank You, I have read bits and pieces of the content dispostion specs, but did not really understand them. Now I have read the specs fully and will attempt to put into action...

Sometimes it just takes a tap to get the ol ball rolling. Thanks Again
×

Success!

Help @robertketter spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...