Click to See Complete Forum and Search --> : "File Download" Dialog Box


mascardr
03-27-2003, 04:30 PM
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 ?

Thanks,
Debra

jpmoriarty
03-27-2003, 05:28 PM
i dont think you can if they have word installed - it will "grab" it and be really helpful (annoying?) and open it direct.

Best way i know of is to zip it up - that way it will always open that dialogue of which you speak.

mascardr
04-07-2003, 12:59 PM
I found out that the browser takes care of that. Thank you for replying.

Debra

jpmoriarty
04-07-2003, 02:18 PM
if you use a server side coding, however, you can send a header to make it download the file:

this is a php example:


<?php
header("Content-type: application/doc");
// i'm guessing at the line above - i dont think it *really*
// matters, but i may be wrong
header("Content-Disposition: attachment; filename=downloadme.doc");
// this is the name that it suggests to save the file under
readfile('thisfile.html');
// this is the name of the file on your system
?>

Robert Wellock
04-08-2003, 11:55 AM
Alternatively if you have enough control over an Apache server you could place the following within the .htaccess AddType application/octet-stream doc