Highly compressed games. Convert byte array to PDF without saving as a file. Visual Basic.NET Forums on Bytes. ![]() All, I hope someone can help me here. Here is my problem. I put an ASP.NET (C#) application in place a few weeks ago. Everything is humming along great but then I get a call from the owner of the site telling me that the PDF files are no longer displaying. I check this and sure enough, when you click on the link that displays the PDF file, the browser seems to lock up or just go blank. What's weird is, we discovered that if you hit the refresh button on the browser the PDF file will load into the browser just as it always did. Another frustrating thing - Firefox does not have this problem. It displays the file just fine. I have rebooted the server, restarted IIS, recycled the application pool, waved dead chicken bones over the computer - all to no avail. I stream the PDF files to the browser because they contain private information and they are not located within the web site itself. The application opens the PDF file and then streams it to the browser. Here is the code that I use: Response.Buffer = true; Response.Clear(); Response.ClearContent(); Response.ClearHeaders(); Response.ContentType = 'application/pdf'; Response.AddHeader('Content-Disposition', 'CIC Report'); FileStream fs; BinaryReader br; fs = new FileStream(documentPath, FileMode.Open); br = new BinaryReader(fs); Byte[] dataBytes = br.ReadBytes(( int )(fs.Length - 1)); Response.BinaryWrite(dataBytes); br.Close(); fs.Close(); I have been racking my brain on this for about five or six hours and cannot find a solution. I have double checked my code against what others are doing and it appears the same. I have even tried a different method of streaming the data down with the same results. What kills me the most is this worked for two weeks without any problem and then suddenly just stops. I have tried it from multiple machines, all with the same results. Thanks for any help you can offer, Kevin Firefox ASP.NET 1.x IE ASP.NET c# PDF • •. Well, after a while I gave up and called Microsoft. It was well worth the money spent on the support call as it took them almost five hours to figure out what the problem was. It turns out that somehow the 'compress application files' checkbox had become checked under the service tab of the website properties. Apparently, the combination of IE6 + PDF + SSL? And this checkbox was a lethal combination. I hope this benefits someone. Firefox ASP.NET 1.x IE ASP.NET c# ASP.NET 2.0 asp.NET 2.0 C# PDF • •. Hi All, I suffer with you same problem about the four hours, I found a answer you need Set in aspx page <%@ Page aspCompat='True' other attributes%> Also, make sure your ASP/ASP.NET script contains no HTML tags whatsoever to avoid HTTP stream corruption. My code is very similar of yours HttpContext.Current.Response.AddHeader('Content-Disposition', 'inline;filename=file.pdf'); HttpContext.Current.Response.ContentType = 'application/pdf'; HttpContext.Current.Response.BinaryWrite(dataBytes); John • •. I have tried, what feels like, hundreds of different browser 'header' combinations and incantations - and could not get SSL / PDF / IE6 to launch documents correctly without getting various errors. Alarm for Cobra 11 Crash Time Free Download PC Game setup in single direct link for Windows. It is an awesome Action, Racing and Driving game. Cobra alarm system. Postmortem no CD Alarm for Cobra 11: Burning Wheels v1.0 All. Alarm For Cobra 11 Crash Time Free Download Full Version RG Mechanics Repack PC Game In Direct Download Links. It Is Highly Compressed Game. Alarm For Cobra 11 Autobahn All Access Cheat By Pizza Download Search Tips Your search for Alarm For Cobra 11 may return better results if you avoid searching for words like: crack, serial, keygen, activation, code, hack, cracked, etc. Hi, I had the very same problem trying to stream a PDF file on IE6 with Acrobat Reader 6 is installed on clients. Here's my code, the page is called DownloadFile.aspx: Response.Clear(); Response.ClearHeaders(); Response.ClearContent(); Response.ContentType = 'application/pdf'; Response.AddHeader('content-disposition','inline;filename=report.pdf'); Response.BinaryWrite(pdfFileBuffered); Response.End(); When I execute it on IE6, both by debbuging it on VS2005 () or on a server, a blank page is shown. After spending hours debugging, in forums and reading articles, I came across this interesting piece of information: ' Internet Explorer first consults the and headers for the MIME type from the HTTP server, if they exist. Next, Internet Explorer consults the registry entry for that MIME type under HKEY_CLASSES_ROOT MIME Database Content Type and looks at the Extension key for the correct file extension. Internet Explorer then ensures that the file has that extension, before placing it in the local browser cache.' Source: (Handling MIME types in Internet Explorer) This means that if one uses only,no matter how correct is the content-type and content-disposition, IE will not show the page correctly because the URL does not contain the word.pdf in it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |