• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net

Auto-Download HTML files

ashben

Moderator
Is it possible to have HTML (*.html or *.htm) files automatically download (with the Save As dialog box) instead of being parsed by the browser. For example if someone visits an HTML page with some information on it, I wish to provide them with a link to download the same html file onto their machine. The solution has to work on both IE and Netscape.
 
I don't think that would be viable, however it might be possible to do with php, i once did a project that allowed a txt file to be downloaded instead of opened.
 
using a header on the top of the php page like:

header( "Content-type: application/x-gzip" );
header( "Content-Disposition: attachment; filename=some-file.tar.gz" );
header( "Content-Description: PHP3 Generated Data" );
 
Thanks a ton. The "Content-Disposition" header definition works just fine. I researched a bit more on it and got it to work for PDF's and DOC's as well.
 
Back
Top