Forum Moderators: coopster

Message Too Old, No Replies

Not sure how to word this but .

Cant get download managers to work with ...index.php?file=0001

         

IamStang

3:04 am on Oct 9, 2006 (gmt 0)

10+ Year Member



Sorry for the poor subject line. My brain is fried from trying to find an answer to my problem and I just couldnt think of a short way of putting this.

Basically, I am attempting to write code that a download manager can understand, so to speak. My links on my site are as such:

[mysite.com...]

They open fine in a browser. However, if a download manager is used, all the visitor will get is, of course, "index.php". I know it is possible to use a link like above with download managers. I've seen numerous sites incorporate this.

If anyone knows how this is done, please point me in the right direction. I dont need "cut and paste" code, just the basics. I'll take it from there (I Hope).

TIA!
IamStang

scriptmasterdel

8:31 am on Oct 9, 2006 (gmt 0)

10+ Year Member



What would be great is if you could show us some
code of what the get "file" variable actualy does
this would be a great start in trying to help
you out

IamStang

11:35 am on Oct 9, 2006 (gmt 0)

10+ Year Member



The "get" files main purpose is to, more or less, "hide" the actual location of the file and verify the visitor clicked the link on my site (via a cookie check).

I know this isnt 100% foolproof. But for what it is for, it will suffice.

whoisgregg

5:38 pm on Oct 9, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if a download manager is used, all the visitor will get is, of course, "index.php".

The "of course" bit is sticking with me. A download manager should exhibit the same behavior as a browser.

What headers are you sending in your index.php?file=0001 script?

IamStang

9:23 pm on Oct 9, 2006 (gmt 0)

10+ Year Member



The headers is probably where my problem lies. I am in no way smart on them or their use. Currently it is set as such:

header("Content-Transfer-Encoding: binary");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: ".$xtype);
header("Accept-Ranges: bytes");
header("Content-Disposition: attachment; filename=\"".$filename."\";");
header("Content-Length: ".$filesize);

$xtype is set based on the filetype (or extension)
The other variables should be self explanatory.

The above is "modified" from another script. Could it be the "Catch-Control" portion?

Regardless of where the problem lies, I would like to learn more about headers. Anyone have any suggestions on information? Maybe that is best left to another thread?

Thanks for the time you folks spend on this.

IamStang

12:35 am on Oct 10, 2006 (gmt 0)

10+ Year Member



Got it working now fellas.

The problem was due to a cookie not getting set. Once I ironed that part out it works great.

Thanks ALL!