Welcome to WebmasterWorld Guest from 54.147.44.93

Forum Moderators: ocean10000

Message Too Old, No Replies

Viewing a Word Document

The Word doc is stored in a password-protected folder

     

rcshield

5:57 pm on Nov 3, 2009 (gmt 0)

5+ Year Member



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

6:09 pm on Nov 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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

7:12 pm on Nov 3, 2009 (gmt 0)

5+ Year Member



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

7:26 pm on Nov 3, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



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?
 

Featured Threads

Hot Threads This Week

Hot Threads This Month