Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Actually i am getting this error in my website while viewing the document in Production site...but when i am testing in local system it is not coming so can any one say what was the problem...........and here one more thing it is not coming to every user for one user it is coming.....

Here is my code

C#
if (path != "")
                           {
                               Response.ClearHeaders();
                               Response.ContentType = "application/octet-stream";

                               if ((Request.Browser.Browser.ToLower() == "ie") && (Request.Browser.MajorVersion < 9))
                               {
                                   Response.Cache.SetCacheability(HttpCacheability.Private);
                                   Response.Cache.SetMaxAge(TimeSpan.FromMilliseconds(1));
                               }
                               else
                               {
                                   Response.Cache.SetCacheability(HttpCacheability.NoCache);//IE set to not cache
                                   Response.Cache.SetNoStore();//Firefox/Chrome not to cache
                                   Response.Cache.SetExpires(DateTime.UtcNow); //for safe measure expire it immediately
                               }

                               Response.AppendHeader("Content-Disposition", "attachment; filename=" + fileName);
                               Response.TransmitFile(strURL);
                               string Viewed = "Viewed  - " + fileName;

                               obj.UserId = Session["UserId"].ToString();
                               obj.DocAccess = Viewed;
                               obj.PageType = "Web";
                               obj.Message = Session["UserID"] + "  has viewed the CCD document " + fileName;
                               int i = NlogObj.Logstore(obj);


                               HttpContext.Current.ApplicationInstance.CompleteRequest();
                           }
Posted
Updated 10-Feb-14 20:19pm
v3
Comments
Sampath Lokuge 11-Feb-14 2:01am    
Can you put the code snippets which related to this issue ?
ntitish 11-Feb-14 2:20am    
I update my question with related code.........
Bernhard Hiller 11-Feb-14 3:00am    
Of course the question is: in which line does the error occur?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900