How to avoid open/save dialog box while accessing a word document from server

  • Follow


hi to everybody,

i have define a link which say like below
<a href=/one/two/test.doc target="_blank">download document</a>

when i click "download document" link one dialog box appears asking
open/save/cancel


now i need to avoid that dialog box and need to download the document
directly.

can anybody help me please how to avoid that dialog box?
(it should only ask for place where i can store)


thanks and take care to all.
0
Reply RAJ 3/4/2008 11:10:59 AM

RAJ wrote:
> hi to everybody,
> 
> i have define a link which say like below
> <a href=/one/two/test.doc target="_blank">download document</a>
> 
> when i click "download document" link one dialog box appears asking
> open/save/cancel
> 
> 
> now i need to avoid that dialog box and need to download the document
> directly.
> 
> can anybody help me please how to avoid that dialog box?
> (it should only ask for place where i can store)
> 
> 
> thanks and take care to all.

Hi,

You'll have to send the right headers too from the server.

 From PHP for example:
header("Content-type: application/msword");
header("Content-Disposition: attachment; filename=worddoc.doc");

Maybe a few more headers are needed.
Try the above, and Google around.

Good luck.

Regards,
Erwin Moller
0
Reply Erwin 3/4/2008 2:03:16 PM


RAJ wrote:
> i have define a link which say like below
> <a href=/one/two/test.doc target="_blank">download document</a>

http://validator.w3.org/

> when i click "download document" link one dialog box appears asking
> open/save/cancel
> 
> now i need to avoid that dialog box and need to download the document
> directly.

Four get it. [psf 4.13]


PointedEars
-- 
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
0
Reply Thomas 3/4/2008 3:09:55 PM

2 Replies
337 Views

(page loaded in 0.06 seconds)

Similiar Articles:









7/23/2012 5:10:56 PM


Reply: