Download Link in a Podcast
Support Area › Forums › Authentic › Download Link in a Podcast
- This topic has 6 replies, 2 voices, and was last updated 11 years, 1 month ago by Bill Robbins.
-
AuthorPosts
-
August 31, 2013 at 14:21 #13565JeremyParticipant
Bill –
Love this theme and the work you do! Thanks!
I’m working on a podcast for a church’s website: http://gracelutheran-hayward.org/
Instead of uploading sermon mp3 to the wp-content folder on my server, I am using an Amazon S3 bucket instead as the holder of these files. I inserted the link URL into the correct field when “Adding a New Podcast.” Streaming works fine, however the download link (in the podcast post and the podcast archive, not the podcast widget on the home page) is producing something wonky:
[audio src="https://gracelutheran-hayward.org/wp-content/themes/authentic-v1-3-12/includes/download.php?file=https://s3.amazonaws.com/gracelutheran/Sermons/Being+a+Disciple/2013-07-14KnowYourSpiritualGifts.mp3" /]
When I click on the above link, it produces a file that looks like this on my computer when I download:
https—s3.amazonaws.com-gracelutheran-Sermons-Being a Disciple-2013-07-14KnowYourSpiritualGifts.mp3
It seems the “://” after the http is changed to three dashes. I’ve looked at the download.php file, which seems to be the one making this decision, but I can’t understand the markup language 🙂
Any ideas on how to make that actually work?
Thanks!
September 2, 2013 at 12:53 #13586Bill RobbinsModeratorJeremy,
Serving your files from Amazon can be a great option–many hosts frown on streaming MP3’s or videos from their servers.
Sometimes the download script can give trouble, especially if the file is from a different server. One option you might try would be to replace the one included with the theme, with a different one. Here’s how:
- Go to the Appearance section in your WordPress control panel and select Edit.
- From the list of files on your right, choose download.php
- Replace all the content there with this:
- Update your settings.
Hopefully that will work out better. If it doesn’t, let me know and there is a HTML5 method we can give a shot.
Thanks and have a great week,
BillSeptember 2, 2013 at 13:01 #13588JeremyParticipantIt didn’t work, Bill. It downloads a file called “mp3” and it contains 0 bytes 🙂
Yeah, since I’m hosting this client’s account on my VPS, I definitely don’t want them streaming mp3’s on my server 🙂
September 3, 2013 at 08:53 #13599Bill RobbinsModeratorJeremy,
I’m still looking for a force download option that will work with files hosted on a different server. I didn’t want you to think I had forgotten you, but I’m still tracking down a solution for that situation.
If I can’t find one, we can always change the link to point directly to the file with a right click and download message.
Bill
September 4, 2013 at 09:34 #13625Bill RobbinsModeratorI’m still searching for a solution that will work reliably with files hosted remotely. I’m soon going to move my own church’s media files to S3, so I’ll find a solution soon.
Until then, let’s change those links so they at least function even if it’s not as seamless as we’d like.
Here’s what you’ll need to do:
- Go to the Appearance section in your WordPress control panel and select Edit.
- From the list of files on your right, choose single-podcast.php and find this line:
<a href="<?php echo get_template_directory_uri(); ?>/includes/download.php?file=ID, "message_audio", TRUE); ?>"><?php _e('Download', 'organizedthemes'); ?></a>
- Replace that with this:
- Save your changes.
- You’ll also need to edit the archive-podcast.php file and change that line twice in it.
- The last file that has that is widget-podcast.php where you’ll need to change it too.
If you run into any questions or trouble, let me know,
BillSeptember 4, 2013 at 09:56 #13626JeremyParticipantThat works. I can see what you did there. Instead of forcing the download, you’re just providing the URL link and then instructing the user to force the download themselves by right click and save as.
On our church’s website, we also use S3 for our mp3 files. There is no PHP magic happening in the background. What we’ve done is provide a button that says LISTEN ONLINE, which when clicked, opens up a new window and trusts that the users computer is going to know how to play the mp3 locally (either in the browser or via the media player). The other button is DOWNLOAD mp3, which when clicked, the download is forced.
In order to do this, we upload the sermon audio file twice to S3. One is normal. The other we add “dl” to the file name and change the HTTP header to Content:attachment (which forces the download). I know of no other way at the moment, how to provide both options with one file.
This works, though for this church. It’s functional. If we can figure out how to force the download later… that would be cool, too!
Thanks, Bill!
September 4, 2013 at 11:27 #13629Bill RobbinsModeratorInteresting system you have created there. I’ll keep on looking and if I find a good option, I’ll include in a theme update for everybody.
Thanks again,
Bill -
AuthorPosts
- The topic ‘Download Link in a Podcast’ is closed to new replies.