Welcome to WebmasterWorld Guest from 18.104.22.168 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Pubcon Platinum Sponsor
Viewing a Word Document The Word doc is stored in a password-protected folder rcshield msg:4018364 5:57 pm on Nov 3, 2009 (gmt 0) I have some Word documents that are linked to a page on a Web site. Both the Web page and the Word documents reside in a password-protected folder on the Web server. I have to login to view the Web page. However, I sometimes have to login once more when I click a link to open one of the Word documents. Does anyone know why I would be prompted to login a second time even after I logged in to view the password-protected Web page?
marcel msg:4018368 6:09 pm on Nov 3, 2009 (gmt 0)
Does anyone know why I would be prompted to login a second time even after I logged in to view the password-protected Web page? Are you using IE? or some other browser? rcshield msg:4018431 7:12 pm on Nov 3, 2009 (gmt 0)
I am using IE. I do not experience the issue with Firefox because firefox automaticcly prompts me to save the document to my workstation. marcel msg:4018439 7:26 pm on Nov 3, 2009 (gmt 0)
Oh, I thought it would be the other way around... that Firefox would force you to login twice.
One option is to always force a download, you can do that with the following code (C#)
string filepath = Request.QueryString.Get("/Docs/WordDoc.doc"); string filename = System.IO.Path.GetFileName(Server.MapPath(filepath)); FileInfo fi = new FileInfo(Server.MapPath(filepath)); Response.Clear(); Response.AddHeader("content-disposition", "attachment;filename=" + filename); Response.AddHeader("Content-Length", fi.Length.ToString()); Response.ContentType = "application/msword"; Response.WriteFile(Server.MapPath(filepath)); Response.End(); If that is not an option, how are you protecting the folder? Through IIS, or in the folder properties itself?