"File Download" Dialog Box

admin

Administrator
Staff member
I have a list of Word documents and I want a dialog box to come up for the user to either save or open the Word document when they click on the link. Can someone tell me how to do this ? Is it something really compex ?<br />
<br />
Thanks,<br />
Debra<!--content-->i dont think you can if they have word installed - it will "grab" it and be really helpful (annoying?) and open it direct.<br />
<br />
Best way i know of is to zip it up - that way it will always open that dialogue of which you speak.<!--content-->I found out that the browser takes care of that. Thank you for replying.<br />
<br />
Debra<!--content-->if you use a server side coding, however, you can send a header to make it Download <!--more--> the file:<br />
<br />
this is a php example:<br />
<br />
<br />
<?php<br />
header("Content-type: application/doc");<br />
// i'm guessing at the line above - i dont think it *really*<br />
// matters, but i may be wrong<br />
header("Content-Disposition: attachment; filename=Download <!--more-->me.doc");<br />
// this is the name that it suggests to save the file under<br />
readfile('thisfile.html');<br />
// this is the name of the file on your system<br />
?><!--content-->Alternatively if you have enough control over an Apache server you could place the following within the .htaccess AddType application/octet-stream doc<!--content-->
 
Back
Top