Want to track download, then redirect
Posted: Thu May 15, 2003 12:14 am
I want to have it so that instead of directly linking to my file, I call a php script with the name and type of the file and then log the info in my database and then pass the link on to the user. I can do all the database stuff no problem, and have gotten all the way down to the part where I have both a relative path to the file and the full URL to the file. My problem is that now I have no clue how to actually let the user get the file.
I have 2 file types I need to worry about: MP3 and RealAudio. I thought you were supposed to do something like this:
header("Content-Type: audio/x-pn-realaudio"); for a realaudio file...and audio/mp3 for an mp3 file.
My problem is that nothing happens! you just see a blank page. My first guess was to just do:
header("location: " . $filename);
But for my realaudio file (a .ram file), it literallly opens the .ram file and displays it on screen instead of opening up realplayer and playing the .ram file. Same problem with MP3, it downloads it then displays it.
How can I get the browser to then pass off the link????? Thanks a ton for your help, I appreciate it.
I have 2 file types I need to worry about: MP3 and RealAudio. I thought you were supposed to do something like this:
header("Content-Type: audio/x-pn-realaudio"); for a realaudio file...and audio/mp3 for an mp3 file.
My problem is that nothing happens! you just see a blank page. My first guess was to just do:
header("location: " . $filename);
But for my realaudio file (a .ram file), it literallly opens the .ram file and displays it on screen instead of opening up realplayer and playing the .ram file. Same problem with MP3, it downloads it then displays it.
How can I get the browser to then pass off the link????? Thanks a ton for your help, I appreciate it.