Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Feb 2011
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Audio download links

    Hi peeps
    I'm trying to sell digital Audio on my webpage using paypal to receive payments. This then will direct to a thank you page where the download can begin (I realise this isn't the most secure way of doing it since people can simply copy and share the download link, but this is another issue).

    My main problem is when the link is clicked, instead of initiating a download, it opens a new page where the audio plays in the browser instead of downloading.
    Is it because I need to zip it? If that's the case then what if my customers don't have unzipping software.
    Thanks

  • #2
    Regular Coder
    Join Date
    Apr 2011
    Posts
    286
    Thanks
    2
    Thanked 39 Times in 39 Posts
    You need to tell the browser its an attachment/download, here is a link that shows a good example of what headers are needed, mainly the:

    Code:
    header("Content-Disposition: attachment; filename=\"".basename($filename)."\";" );
    http://www.elouai.com/force-download.php

    Other possibility is to set the content type to something that won't autoplay for the file type.

    Or, the easiest would be just to zip them.

  • #3
    New Coder
    Join Date
    Feb 2011
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Wojjie View Post
    Or, the easiest would be just to zip them.
    Thanks, this is what I was thinking. But what if my customer doesn't have a unzip package?
    Or are they pretty much standard with all pcs nowadays?

  • #4
    Senior Coder DanInMa's Avatar
    Join Date
    Nov 2010
    Location
    Salem,Ma
    Posts
    1,577
    Thanks
    13
    Thanked 248 Times in 248 Posts
    windows has native .zip functionality as of windows xp sp3. there are many free programs online that can also handle zip files that you could refer to your users.

  • #5
    Regular Coder
    Join Date
    Apr 2011
    Posts
    286
    Thanks
    2
    Thanked 39 Times in 39 Posts
    Like DanInMa said, it is almost standard today.

    There are newer technologies like gzip, bzip2 that not every machine has, but zip has been around for a long time.

  • #6
    New Coder
    Join Date
    Feb 2011
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Okay thanks. I'll do that then.
    I just don't like the thought of customers becoming frustrated having to download software is all.
    Thanks

  • #7
    Regular Coder
    Join Date
    Apr 2011
    Posts
    286
    Thanks
    2
    Thanked 39 Times in 39 Posts
    You can always give them the link to the mp3 and tell them to right click and click save as as a back up plan.

  • #8
    New Coder
    Join Date
    Feb 2011
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Wojjie View Post
    You can always give them the link to the mp3 and tell them to right click and click save as as a back up plan.
    That's okay. Ill just go with the zip plan. I can always change it if customers are having trouble. Thanks.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •