Forum Moderators: phranque
What you have to do is "munge" the content type being sent to the browser, basically creating a content-type the browser won't recognize. Generally this is done with a with a dynamic server-side language.
Using my favorite, perl,
open <FILE,"$pdf_file">;
$file = <FILE>;
close (<FILE>);
Now my entire pdf is stored in $file. Normally, the server sends the content-type of application/pdf for this file, and if it doesn't the browser might figure it out, but we need to trick the browser into forcing a download:
print "content-type:bad/type\n\n";
#or
#print "content-type:any/unrecognized_type\n\n";
print "$file";
exit 0;
The unrecognized MIME type forces the browser to download the file, as it doesn't recognize the type.
There's more to the story, such as content-disposition and how to populate the file dialogue box with the file name, but that's the gist.
If you're not up to this, the simplest solution is a clear set of instructions: "Right-click THIS LINK and select 'Save Target As' from the context menu to download my ebook. Macintosh users, hold down your Apple key before clicking the link."