php donwload script and htrewrite

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
benyboi
Forum Commoner
Posts: 80
Joined: Sat Feb 24, 2007 5:37 am

php donwload script and htrewrite

Post by benyboi »

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.
User avatar
Mordred
DevNet Resident
Posts: 1579
Joined: Sun Sep 03, 2006 5:19 am
Location: Sofia, Bulgaria

Re: php donwload script and htrewrite

Post by Mordred »

Install a local proxy (like Paros or Proxomitron, etc) and watch the raw HTTP that the DM uses.
Post Reply