php donwload script and htrewrite
Posted: Fri May 16, 2008 10:37 am
Hello,
I have a php download script which works like download.php?file=this.avi which works fine in IE, FF and download managers etc.
Now i wanted to make it more formal and have site.com/downloads/this.avi and rewrite it through the original script. I got this to work and it works fine in IE/FF untill you try using a download manager (i used IDM) in which case it hangs for 5 seconds then tries to load something for another 5 then just "crashes" and takes you to a log in screen which is only ment to be seen if the user is not logged in - but i already am. (The script checks a cookie to see if the user is logged in then does some mysql queries to check they have access, if not logged in it makes them log in, if no access it tels them why not etc.)
I have no idea where the problem is, although i have a feeling it could be something to do with headers that IDM uses, such as HTTP_RANGE not being passed through the htaccess rewrite? Although i don't know why this would cause it to "loose" the cookie and think you are not logged in though.
Could this be the case? And what would i have to do to solve it?
Thanks guys!
P.S I know this is maybe more a htaccess problem but theres no dedicated htaccess help forum and i though most guys here would know a thing or two about htaccess so i figured i would post here.
I have a php download script which works like download.php?file=this.avi which works fine in IE, FF and download managers etc.
Now i wanted to make it more formal and have site.com/downloads/this.avi and rewrite it through the original script. I got this to work and it works fine in IE/FF untill you try using a download manager (i used IDM) in which case it hangs for 5 seconds then tries to load something for another 5 then just "crashes" and takes you to a log in screen which is only ment to be seen if the user is not logged in - but i already am. (The script checks a cookie to see if the user is logged in then does some mysql queries to check they have access, if not logged in it makes them log in, if no access it tels them why not etc.)
I have no idea where the problem is, although i have a feeling it could be something to do with headers that IDM uses, such as HTTP_RANGE not being passed through the htaccess rewrite? Although i don't know why this would cause it to "loose" the cookie and think you are not logged in though.
Could this be the case? And what would i have to do to solve it?
Thanks guys!
P.S I know this is maybe more a htaccess problem but theres no dedicated htaccess help forum and i though most guys here would know a thing or two about htaccess so i figured i would post here.