How to make my music files downloadable.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • gabor
    Captain

    • Feb 2008
    • 242

    #16
    Re: How to make my music files downloadable.

    Naval,

    me mucho stupido (dumbass)

    (But I'm gonna try - it will be a challenge...)

    Thanks again
    www.gabor-music.com

    Comment

    • DannyJoe
      Private First Class

      • Apr 2012
      • 5

      #17
      Re: How to make my music files downloadable.

      Hey Guys,

      I know this is kind of an old thread but I have a question that's directly related to it and thought maybe Navel or someone else could help me out with this.

      I have a sub-domain website with a movie on it that I produced (and hundreds of people are waiting to see) that's scheduled to be released soon. It's free to watch but people have the option to donate if they'd like which gives them the ability to download the movie. When they click donate, they are directed through PayPal which, after donation is complete, sends them to 6statetour.gnldteam.com/thankyou.html where they can choose what format of video they want to download. I want it to start the download when they click on the link and I don't want the video in a zip file. I spent ALL DAY today (and yesterday) working with Navels download PHP above but I can't get the video files to start downloading. If I insert a .jpg link, it works perfectly but it won't start downloading any of the videos (.avi .mp4 .flv) which is what I need. It just shows a blank white page. Is there something I need to insert like MIME? This is probably a 2 second problem for you guys, but I just don't get it.

      Here's the code I have in a PHP file called "download" in the main folder.

      <?php
      error_reporting(0);
      $folder = "moviedownloads"; // This is the folder where your files are, make its name rather strange like "hJ68bkG9"
      $file[1]= "6-State-Tour-Movie-The-Hanson-Family-Singers.avi";
      $file[2]= "6-State-Tour-Movie-The-Hanson-Family-Singers.mp4";
      $file[3]= "6-State-Tour-Movie-The-Hanson-Family-Singers.flv";
      // Add as many as necessary
      Output:$file_name = $file[intval($_GET['id'])];
      $file_path= $folder."/".$file_name;
      $file_type = filetype($file_path);
      $data = file_get_contents($file_path);
      $file_size = strlen($data);
      $header .= 'MIME-Version: 1.0'.$eol;
      header("Pragma: public");
      header('Expires: '.gmdate('D, d M Y H:i:s').' GMT');
      header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
      header("Cache-Control: private",false);
      header("Content-type: Application/ $file_type");
      header("Content-Disposition: attachment; filename=$file_name");
      header("Content-Description: Download PHP");
      header("Content-Length: $file_size");
      header("Content-Transfer-Encoding: binary");
      echo $data;?>

      The full link to the folder containing the videos to be downloaded is http://gnldteam.com/6statetour/moviedownloads/ and the full links to the video files are:





      In the BV program link settings, I'm linking to ./download.php?id=1 etc. It either downloads the PHP file or goes to the blank white screen unless you have a .jpg link set up to download, then it works. (the Happy-new-year-2011.jpg file in "moviedownloads" was my test file)

      I feel like I'm getting very long winded here. Hopefully I gave you guys all the info you need and didn't miss anything or type something wrong so you can check it out right away. If you need anything else, let me know!

      The main address where this all starts is: www.gnldteam.com/6statetour and is a completely separate enterprise from www.gnldteam.com.

      Thanks so much in advance for your help!

      Daniel Hanson
      www.hansonfamilymusic.com

      Comment

      • DannyJoe
        Private First Class

        • Apr 2012
        • 5

        #18
        Re: How to make my music files downloadable.

        Never mind! I took a break from it yesterday then came back this morning, spent 5 more hours on it and figured out how to make the videos download.

        I hope no one has spent any time trying to figure this out for me. If you have, thank you!

        I'm super happy right now!!! :) Thanks again guys and take care!

        Comment

        Working...
        X