0

I an trying to open word document on hyperlink click. Now below code is opening dialogbox ans asking for saving.

How to open directly word document without user asking dialogbox for saving or open? just need to popup with word doc.

Response.Clear()
    Response.ContentType = "application\msword"
    Dim file As New System.IO.FileInfo(Server.MapPath("/UserManual\Carangi Reunderwriting Website User Manual.docx"))
    Response.AddHeader("Content-Disposition", "inline; filename=" + file.Name)
    Response.AddHeader("Content-Length", file.Length.ToString())
    Response.TransmitFile(file.FullName)
    Response.Flush()
    Response.End()
James123
  • 11,184
  • 66
  • 189
  • 343
  • Not sure why someone downvoted, as the question is legitimate (though I suspect it's not possible in a traditional web scenario). – mason May 12 '14 at 19:11

1 Answers1

0

Browser settings can override the content-disposition header. You might want to check and see if your document opens inline in another browser or on another machine. Seems to me that conservative default settings these days should show a save dialog before opening a word document from a web page.

esmoore68
  • 1,276
  • 1
  • 8
  • 16