does anyone have an idea as to how to hide the realaudio .rm or .ram files path while serving it up thru a browser.

reg
kevin

    There's code in this post for images:

    http://www.phpbuilder.com/board/showthread.php?s=&threadid=10263028

    The code here assumes the file is stored in the database. If yours is not, you can ditch the database code and swap in code to read the file into a variable. Remember to set the content type to the matching mime type for RealAudio.

    Another approach is if you have the files in a directory on an Apache web server, you could use .htaccess and mod_rewrite to rewrite the URLs. Although I think the files still have to be in a publicly accessible spot while the above file reading trick allows you to pu tthe files anywhere, including a secured directory. The .htaccess trick will "hide" a directory though. It just depends on how secure you want it.

      Hi,
      I think you can store the path of name in a db.

      Link the file as <a href="sendaudio.php?num=123">Smells like teen spirit</a>

      Then do a php file like this:

       
      //connection to db - $file is 123... 
      
      $query="select filename from <imagedb> where id=$file" 
      $result=mysql_query($query) or die ("Error: ".mysql_error()); 
      $row=mysql_fetch_row($result); 
      
      header('Content-type: audio/x-pn-realaudio'); 
      readfile($row[0]);
      

      This thread maybe usefull
      http://www.phpbuilder.com/board/showthread.php?s=&threadid=10263028

      see you.

      (If work you'll hear:
      ...
      And I forget just why I taste
      Oh yeah, I guess it makes me smile
      I found it hard, it was hard to find
      Oh well, whatever, nevermind
      ...) 🙂

        thanks for the replies. i want to hide the path to realaudio files not images.

        it doesnt work the same way because of the way the realaudio player reads the .rm or .ram files.

        reg
        kevin

          Its a matter of changing the mime type you send to the browser. If you're using IE, you will probably have to specify the filename as well in the header since IE is driven by the file extension and not the mime type.

            this is a realplayer question, not a php one.
            you can obscure the url with apache, but if realplayer isn't using http via apache, there's nothing php can do to help you.

            what i have seen some sites do is use a short film to load the main one. it stops you ripping the stream, at least, and will hide the url, but i don't know how you use it to prevent unauthorized usage.
            http://www.liverpoolfc.tv use something like this on their realplayer streams.

              well what im trying to do is this. when ppl visit the site they have an option of adding realaudio songs to their playlist. [ goes to DB with session id]
              once they are done the click on play and the realaudio player is loaded in a pop-up window, reads the songs from the db and writes it to a .ram file.
              all this si done through PHP.
              however all someone has to do is view source and they can find out the location of .ram file [ and subsequently the realaudio files]

              ive tried to create the .ram file through get_file.php?id=whatever but realplayer doesnt accept this , it needs an actual file to be present.

              reg
              kevin

                What if you rename the output file?

                 
                $query="select filename from <songdb> where id=$file"  
                $result=mysql_query($query) or die ("Error: ".mysql_error());
                $row=mysql_fetch_row($result); header('Content-type: audio/x-pn-realaudio');
                // this will give a name .ram header("Content-Disposition: attachment; filename=\"smell.ram\""); readfile($row[0]);

                Maybe this will work... (but is buggy on firebird e mozilla (http://www.phpbuilder.com/board/showthread.php?s=&postid=10450962#post10450962))

                  Write a Reply...