Download Link in a Podcast

Support Area Forums Authentic Download Link in a Podcast

Viewing 7 posts - 1 through 7 (of 7 total)
URL to the page in question:
  • Author
    Posts
  • #13565
    Jeremy
    Participant

    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!

    #13586
    Bill Robbins
    Moderator

    Jeremy,

    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:

    1. Go to the Appearance section in your WordPress control panel and select Edit.
    2. From the list of files on your right, choose download.php
    3. Replace all the content there with this:

    4. 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,
    Bill

    #13588
    Jeremy
    Participant

    It 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 🙂

    #13599
    Bill Robbins
    Moderator

    Jeremy,

    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

    #13625
    Bill Robbins
    Moderator

    I’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:

    1. Go to the Appearance section in your WordPress control panel and select Edit.
    2. From the list of files on your right, choose single-podcast.php and find this line:
      
      <a href="&lt?php echo get_template_directory_uri(); ?>/includes/download.php?file=ID, "message_audio", TRUE); ?>">&lt?php _e('Download', 'organizedthemes'); ?>&lt/a>
      
    3. Replace that with this:
    4. Save your changes.
    5. You’ll also need to edit the archive-podcast.php file and change that line twice in it.
    6. 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,
    Bill

    #13626
    Jeremy
    Participant

    That 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!

    #13629
    Bill Robbins
    Moderator

    Interesting 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Download Link in a Podcast’ is closed to new replies.