Welcome to WebmasterWorld Guest from 54.196.244.186

Forum Moderators: ocean10000

Message Too Old, No Replies

Viewing a Word Document

The Word doc is stored in a password-protected folder

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

Junior Member

5+ Year Member

joined:Feb 21, 2006
posts: 54
votes: 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?
6:09 pm on Nov 3, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:732
votes: 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?
7:12 pm on Nov 3, 2009 (gmt 0)

Junior Member

5+ Year Member

joined:Feb 21, 2006
posts: 54
votes: 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.
7:26 pm on Nov 3, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Feb 1, 2005
posts:732
votes: 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?
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members