LOGIN Don't have an account yet?   Register

Forgot password?
 

direct download link for each song individually

  • avatar
    altweb
    on 6/8/11
    Hi.
    I'm wondering how to set direct download link for each song individuality? i already inserted the download link in mp3gallery.xml, but when i click noting happened!

  • avatar
    corneliu.chi
    on 8/8/11
    Setting a direct link to the mp3 file will, most times, open the mp3 in the browser. The mp3 file was probably loading and you couldn't see anything while it loaded. Try using a php file that will force the browser to download the mp3. This would be the code:
                    
    <?php
    $filename = $_GET['f'];
    header('Content-disposition: attachment; filename='.basename($filename));
    readfile($filename);
    ?>
    
                    

    Just create a php file with this code and use it in the XML file like this:
                    
    <buy price="9.99" target="_blank">http://www.yourdomain.com/.../phpFile.php?f=http://www.yourdomain.com/.../Song.mp3</buy>
    
                    

    This will redirect the user to download the mp3 file.
  • avatar altweb
    on 13/8/11
    Thanks alot, work for me.
  • avatar corneliu.chitanu
    on 15/8/11
    It's great to hear this. Enjoy the player!
  • avatar
    sunsetbs
    on 3/12/11
    Hi, I recently used your code as above. It worked correctly but then I started seeing that it was now saving the actual php page instead of the song. Could you please help?
  • avatar corneliu.chitanu
    on 5/12/11
    Hello,

    It should download the mp3 file, if used correctly. Maybe the path to the mp3 file is not correct.

    If you need us to take a look, please buy a support ticket and share a link to your player. We'll find a solution for you. Also, please share the code that you used in the php file.
  • avatar
    johnvella
    on 5/1/12
    i'm trying to implement this but am confused.

    the instructions state that if the url attribute is blank or missing, then the buy/download button will not appear. since there is no url attribute in your example, i get no button.

    also, can you use relative links? for example, content/songs/file.mp3 like in the tags of the example file?
  • avatar corneliu.chitanu
    on 10/1/12
    Hello,

    On your player the buy XML tag might be different. If you have a "url" attribute set the value for it, just like I did under the "buy" XML tags above.

    Yes, you can use relative paths. However, make sure that the path to the PHP file is correct relative to the webpage that uses the player, and the path to the MP3 file (that is given as a parameter to the PHP file) should be relative to the PHP file.

    Hope this will solve the issue.

rss Subcribe to topic RSS

Post a comment

Please login to join the discussions. Don't have an account? Register (it takes 30 seconds)

This week's featured product

Store Locator

This cool AJAX application will enhance your website by showing your stores' locations. You can also display an image and a short description so your users know exactly where to find your business.

Become a premium member

premium membership Flabell and Themesbell membership provides users with the ability to download any of our components for Adobe Flash and website themes for free, during an entire year.
read more