Shared Files Module: PDF link broken in IE

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
1/29/2007 6:14:39 PM
Gravatar
Total Posts 80

Shared Files Module: PDF link broken in IE

1. Upload PDF to shared files module
2. Download in IE6 or IE7 by clicking the filename link.

IE attempts to download the link https://localhost/mojodev/Default.aspx?pageid=14 in my instance and fails. The download icon that uses SharedFilesDownload.aspx works just fine in IE, Firefox, and Netscape.

Note that PDF downloads from the shared file module work fine in Firefox 2.0 and Netscape 7.2.
1/30/2007 12:09:18 PM
Gravatar
Total Posts 80

Re: Shared Files Module: PDF link broken in IE

This is some sort of IE caching problem see this thread lists.evolt.org/archive/Week-of-Mon-20061009/185599.html. Note that i'm using SSL site wide and have caching disabled on every page. If I check the "allow browser caching" in the settings for the page that the shared file module is on then IE behaves properly when clicking the filename link. I tried adding the following headers (as suggested in the thread) to overwrite the "no-cache" settings but they didn't work:
             
  Page.Response.AddHeader("Expires", "0");
  Page.Response.AddHeader("Cache-Control", "private");

Can you think of any way to have the cache disabled for a page and have the shared file link work properly in IE?

-Jesse
1/30/2007 1:38:02 PM
Gravatar
Total Posts 80

Re: Shared Files Module: PDF link broken in IE

Digging deeper into this problem I came across an interesting MS article support.microsoft.com/kb/323308 . In summary the article states that IE has a problem when opening files over SSL with no caching in the http header. They recommend editing the registry on the client side or installing a hotfix. This seems like a poor solution for mojoportal. We need to do something on the server side...perhaps enabling cache for the download only?
1/30/2007 3:38:27 PM
Gravatar
Total Posts 18439

Re: Shared Files Module: PDF link broken in IE

This is fixed in svn branches/2.x

I just changed the filename link to work the same way as the image link. by linking to the download page.

Thanks,

Joe
1/30/2007 5:49:55 PM
Gravatar
Total Posts 80

Re: Shared Files Module: PDF link broken in IE

Cool, that's works. However the SharedFilesDownload page allows caching. After a bit of tedious research and googling I found that the following code disables caching in IE, Firefox, and Netscape while allowing IE to download files over SSL:

---------------------------------------------------------------------------------------------
// Set expiration to prevent IE from caching page when user hits back button HttpContext.Current.Response.Cache.SetExpires(DateTime.UtcNow.AddYears(-1));

// no-store makes firefox reload page
// no-cache makes firefox reload page only over SSL
// IE will fail when downloading a file over SSL if no-store or no-cache is set
HttpContext.Current.Response.Cache.SetNoStore();
//HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.NoCache);

// private cache allows IE to download over SSL with no-store set. HttpContext.Current.Response.Cache.SetCacheability(HttpCacheability.Private);
HttpContext.Current.Response.Cache.SetRevalidation(HttpCacheRevalidation.AllCaches); HttpContext.Current.Response.Cache.AppendCacheExtension("post-check=0,pre-check=0");
----------------------------------------------------------------------------------------------

Why browsers don't adhere to RFC's continues to baffle me!

-Jesse
You must sign in to post in the forums. This thread is closed to new posts.