WordPress.org

Ready to get started?Download WordPress

Forums

mb.miniAudioPlayer - an HTML5 audio player for your mp3 files
[resolved] Problem with Download (3 posts)

  1. brit77
    Member
    Posted 1 year ago #

    Hello,
    I like your plugin and the fact that it has an easy to use download button. However, I'm running into a problem with this very feature!

    When I click the download button and save the file to my desktop, the file is not really downloaded: it is basically empty, at 0 bytes.

    Here's what I did:
    I inserted the mp3 file via the Add Media button; left the title the same as the name of the file; made sure the link URL is pointing to the file, then Insert into Post. No matter what I've tried to fix this, the download file is still 0 bytes. It plays just fine, and if I save the file without this plugin activated (right-click and save as), then it saves correctly, so it's not a problem with the file.

    Here is what I have done to troubleshoot:
    1. disabled all plugins
    2. changed themr to Twenty Eleven
    3. removed plugin and reinstalled
    4. removed mp3 file and re-uploaded

    Next, I tried the plugin and same mp3 file on a different wordpress site (hosted elsewhere) with the same plugin settings and the same theme...and it works just fine there! So, why won't it work on the first site?! I'm not sure what could be causing this issue. Any ideas what else I can do to troubleshoot this?

    I'd appreciate any help you can provide. :)

    http://wordpress.org/extend/plugins/wp-miniaudioplayer/

  2. pupunzi
    Member
    Plugin Author

    Posted 1 year ago #

    Hi,
    That seams to be a PHP settings problem or filesystem permission problem of your web server. If the plugin is activated, the download is managed by the map_download.php page that is in the plugin folder. That page simply get the file stream and serve it for the download.

    As it works fine on all the tests I made on my servers, I suppose the problem is on how your web server is configured.

    You can actually change the way the download button will serve the mp3 file by modifying the mb.miniPlayer js file at line 97 in the plugin folder as follow:

    FROM:

    var download = jQuery("<p/>").addClass("map_download").css({display:"inline-block", cursor:"pointer"}).html("d").on("click",function(){
              // window.open(player.opt.mp3,"map_download");
              location.href = map.downloadUrl+"?filename="+title.asId()+".mp3"+"&fileurl="+player.opt.mp3;
            }).attr("title","download: "+title);

    TO:

    var download = jQuery("<p/>").addClass("map_download").css({display:"inline-block", cursor:"pointer"}).html("d").on("click",function(){
               window.open(player.opt.mp3,"map_download");
              // location.href = map.downloadUrl+"?filename="+title.asId()+".mp3"+"&fileurl="+player.opt.mp3;
            }).attr("title","download: "+title);

    This will open the audio file in a new page instead of downloading it.
    Kip in mind tha next updates of the plugin will overwrite tihs change.

    Bye,
    Matteo

  3. brit77
    Member
    Posted 1 year ago #

    Thanks, Matteo! After poking around google a bit, I came to the same conclusion, that it must be an issue with the web server, but it's good to have some validation. :)

    I like the intended function of your download button, so I definitely wouldn't want to change it! I'll be switching hosts for this site in the near future, so I'm hoping that should fix the problem.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.