Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using include() on a compressed file

Status
Not open for further replies.

BitFuzzy

Technical User
Jun 8, 2001
343
US
I've got a file in a htaccess protected directory, that I want to have downloaded by people authenticated through a mysql database.

the problem that when I use include ("somedir/file.tar.gz"); the result is displayed binary rather than a download prompt.

any suggestions?

Altnernatly I've tried including a html file from the same directory, and have it redirect to the file in question. this ends up giving the expected login pop-up.. (I thought I could embed the authentication into the redirect link.. NOPE! heh)
 
I don't know the exact headers to send, but the first place I'd look is your 'Content-Type:' header sent before the included file. You have to tell the browser it's a zipped binary file of some sort, so that it will know to ask to save (usually) rather than render as some sort of text or HTML.

----
JBR
 
flugh;

that's exactly what the problem was..

I'm set thanks though ;)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top