We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

PDF Download Problems with IIS7 [Answered]RSS

210 replies

Last post Jan 09, 2013 06:20 PM by brent_oly

  • PDF Download Problems with IIS7

    Sep 21, 2009 10:23 AM|aremac|LINK

    Hi,

    I've very recently migrated from a Windows 2003 Standard edition server to a Windows 2008 Server and I'm having problems with PDFs.  When I try to download PDFs, in IE8 they will sometimes download successfully, sometimes partially download and not open and sometimes not open at all.  In Firefox, they just won't open.  I have changed the in-built file download limit of ASP in IIS7 to 15MB from 4MB and that made no difference (my files range in size up to 12MB). 

    The only difference from when my files downloaded properly to now is the change in OS on the server and therefore going from IIS6 to IIS7.

    The files are all appropriately FTP'd onto the server, they are not corrupted (they open perfectly fine on the server itself).  I am absolutely stumped as to what the problem is - possibly an incompatibility between IIS7 and Adobe PDFs of a certain size?  Am I missing a setting in IIS7 which will solve this easily and quickly?

    As a workaround I have tried to change the MIME type in IIS7 for PDFs to application/octet-stream and also tried x-application/attachment to force IE and Firefox (plus other browsers) to download the PDFs rather than try to view them in the browser, which Firefox does perfectly but IE still insists on trying to view in the browser.

    A strange fact is if you download the PDF in Firefox but 'open with Internet Explorer, IE actually opens the file perfectly whereas if you try to open the link directly in IE, it only partially downloads and then stops.

    I'm really, really hoping someone can help me as I don't know what the next step is if I can't fix this and the workaround doesn't work!

    Kind regards,

    Aremac

    iis 7 Windows 2008 Server PDF download problem

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Sep 21, 2009 11:10 AM|Rovastar|LINK

    aremac


    The files are all appropriately FTP'd onto the server, they are not corrupted (they open perfectly fine on the server itself).  I am absolutely stumped as to what the problem is - possibly an incompatibility between IIS7 and Adobe PDFs of a certain size?  
     

    Well is this the case......do small PDF files always open? Is there a limit where you have them.

     Are these direct downloads or going through some other process (you talk about asp limits)

    What is given in the IIS logs?

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Sep 21, 2009 12:02 PM|aremac|LINK

    Hi Rovastar,

    Thank you for replying.  I have went through some files and I range from a 493kb file which doesn't work and on the other side, I have a 5.71Mb file that does work.  I have a bizarre one where 7Mb out of 7.01Mb comes down so the file doesn't actually open!   Sometimes the partially downloaded files stop about 2.5Mb downloaded and some stop at much less.

    I would normally have a link on an ASP page where the link is just a normal URL where the item for downloading is a PDF but just now I am typing the PDF URL directly into the browser (I have had to hide the original page with the links whilst trying to solve this issue!).  As far as I can describe, these files shouldn't be going through any other process, they're direct requests.

    I have checked the IIS logs.  The files are saying status 200 even when they aren't loading fully.  I'm seeing this at times:

    sc-win32-status - with a value of 995.

    Does this mean anything?

    I have changed the ASP Response buffer limit to 15Mb but have noticed that the iis_schema.xml file still states a buffer limit of 3194304 bytes?  From this, I would ascertain that IIS 7 changes aren't being propagated to the iis_schema.xml or web.config files for the domains but then I would surely be having all files not downloading that are over the limit and some do work! 

    Cheers,

    Aremac

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Sep 21, 2009 09:13 PM|Rovastar|LINK

    Ummh what are the file sizes in the logs?

    Are they the bytes as the actual files?

    So all the files have a http status of 200. In that case IIS thinks the they have sent the last packet to the client. If there are network/proxy/firewall issues between IIS and the client machine you could see additional win32 errors (hence why the win32 column is important).

    Can you eliminate an other infrastructure like network/proxy/firewall/load balancer/etc

    Often you will see 64 errors indicting a network failure. The client may or may not have a completed file.

    You coudl also get errors like this with code and double post bugs http://ddkonline.blogspot.com/2008/02/aspnet-double-postback-bug-strikes.html

    or even refreshing repeatly could cause errors like this.

    So you need to just look at the file and no code attached to it.

    I have not recalled seeing the win-32 995 error before.

    995: The I/O operation has been aborted because of either a thread exit or
    an application request. ERROR_OPERATION_ABORTED

    Is it possible to check this on the LAN  where the server is? e.g.Another machine in the Internet infrastructure? As could help in narrowing down problems (network/firewall/proxy/routing/etc) to the client machine?

    Is there anything in the HTTP.sys error logs? This could indict another error.

    AFAIK a http 200 status indicts that IIS has sent the last packet but it does not mean that it left the machine it could be stuck/error in the TCP/IP stack or network card. Maybe try and update your network card drivers?

    Maybe also dig deeper and look at the actual packets going in and out of the webserver using a network analyser tool like wireshark or netmon.

    Hope that helps

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 01:46 AM|rusware|LINK

    Is there any solution to this problem I have the same issue on IIS7.5 Windows 2008 R2 Web Edition.

    Same code in same hosting company on different machine works fine.

    Straight links to PDF's do not download correctly sometimes I get less than 10KB other times I get 200KB but never a full file.

    Thought it was worth mentioning works fine in IE8 or Windows 7 but IE8 on XP no good.

  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 02:30 AM|aremac|LINK

     I found out that when I tested one of my 'non-downloading properly' PDFs on another service in the same local area network, it worked.  The difference?  One server was running Windows 2008 standard edition and the other was running Windows 2008 R2 64-bit datacentre edition.  I couldn't seem to find any solution to the problem so I took the drastic action of having my server re-built with Windows 2003 standard edition (which I'd had previously and which I know all my PDFs downloaded properly on).  I found out that the hosting company re-built my server with Windows 2003 R2 edition, not plain old standard edition as had been requested.  The funny thing is on the server, using IE8, the PDFs still didn't download properly but from local machines, they downloaded just fine (test machines used both Vista and XP).

    I figured it must have been something to do with the R2 configuration but beyond that I don't know why.

    Hope that helps in some small way.

    Kind regards,

    Heather

  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 03:26 AM|rusware|LINK

    Thanks for the info, but this really doesnt help, it is clearly a problem with the IIS 7.5 webserver and I do not have the option of reverting the server to a previous version of windows. 

    I am looking for a solution not a workaround.

  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 12:52 PM|anilr|LINK

    We are investigating an issue with pdf download issue on ws08r2 caused by a change in how ws08r2 does byte-range requests - the bug seems to be in adobe acrobat plugin but it is only exposed by the new byte-range behavior of ws08r2.  We are currently investigating a workaround in ws08r2 to mask the bug in adobe acrobat.

    If this issue is important to you, I would suggest opening a support case so that your business impact is factored into the severity/priority of the issue.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 01:29 PM|aremac|LINK

     Hi,

    That is wonderful news.  I tried for 2 whole weeks to get answers on any relevant forums I could find and I kept coming up against a brick wall every time.  That's why I took the drastic action of re-building my server and migrating all my websites over again.  Not the most fun time I've had but felt I was left with little choice.  I know my option, although a solution, was drastic and a workaround but at the time I wasn't left with any other choice.

    Glad to hear that it's now getting looked into.

    Kind regards,

    Heather (Aremac)

  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 05:19 PM|rusware|LINK

    How do I go about opening a support case? I am in Australia.

  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 05:39 PM|anilr|LINK

    http://support.microsoft.com should have the information.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: PDF Download Problems with IIS7

    Oct 12, 2009 06:01 PM|rusware|LINK

    Anil

    Unfortunately Microsoft support want me to pay over $300 in order to identify and log this as a problem.  I am not willing to pay this when essentialy this is not my problem. 

    I guess I will just have to wait for a solution,  I would appreciate if you could reply to this post when and if a solution is ever found.

    I suppose in future I should take my time upgrading to new versions of server software until all the bug are ironed out.  I am very suprised this problem is not being treated as a HIGH priority by MS as almost every site on the web has a least a few PDF documents on them.

  • Re: PDF Download Problems with IIS7

    Oct 16, 2009 10:57 AM|joseph.ferris|LINK

    We have just ran into the same problem as well, and it is very disappointing to find out that there is not a fix available yet.  Our temporary workaround was to place the PDF documents on another server that we have that is still running Server 2003.

    We will likely be opening a support incident next week with MS, once our admin has enough time to get on the phone with them.

  • Re: PDF Download Problems with IIS7

    Oct 16, 2009 02:47 PM|t.a.King|LINK

    I did open a support incident on this.  On 10/15/2009 the technician working my case said he contacted Anil Ruia, the member of the IIS Core Team who posted earlier in this thread, and was told they are still looking for a workaround, but at that point, it was looking like what was needed was a patch from Adobe.

    I asked him if anyone had let Adobe know this.  His reply: "I had also contacted the escalation engineer from my team who was working with the product team on this issue through another case and he did contact Adobe last week. Their North America offices are closed this week so he expects they will start working on a fix beginning of next week." 

    We moved our 2008 r2 Web server into production on 10/9.  Didn't catch this since 90% of our PDFs are under 1MB, and those seem to be working fine in IE.  Missed the Firefox thing totally and can't think of a good excuse for it, beside being totally focused on figuring out IIS 7.

    Otherwise, I'm really happy with 2008 r2.  Been running it on the home server for a few months, and am running it as my desktop dev environ and am very happy with it.  This is just very unfortunate.

    Next week I'm going to work on finding my own workaround; I was dragging my heals this week, hoping for a patch.  I may fire up the 2003 server and serve the PDFs from there, or write an ASP.Net page that will read the PDF into a stream and feed it directly to the client, bypassing the IIS handler.  Might jigger with IIS setup on our test machine, but it doesn't sound like configuration changes will help.

    I'll post any new information I get here.  Hang in there everyone!  Indicators seem to suggest help is on the way.

  • Re: PDF Download Problems with IIS7

    Oct 16, 2009 02:58 PM|joseph.ferris|LINK

    Thank you for the update!

    We are considering the exact same workaround that you have mentioned.  I was looking at the possibility of streaming PDFs directly through an HttpHandler, regardless of if it was linearized or not.  Glad to see that I am not alone in thinking that is a viable short-term approach.

  • Re: PDF Download Problems with IIS7

    Oct 17, 2009 11:34 AM|Toby.Considine|LINK

    I have to ask a simple question - do you have mime-types properly set up for PDF? Sometimes browsers are clever enough to figure out small files even if the mime types are not set, but choke on doing the same for large files.

  • Re: PDF Download Problems with IIS7

    Oct 18, 2009 05:31 PM|rusware|LINK

    As stated earlier by Anil this is not a MIME type issue, and ny default the MIME type for PDF does exist is IIS 7.5

    If anyone does create a handler could they please post here, save us all having to do the work.

    Much appreciated.

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Oct 18, 2009 06:05 PM|Rovastar|LINK

    This appear only to be an issue with Windows 2008 r2.

    If you are having a problem with standard windows 2008 then it is likely anther issue.

    and AFAIK windows 2008 r2 is still not released for the public yet. Heaven only know why you want them in production.

     

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Oct 18, 2009 11:11 PM|joseph.ferris|LINK

    Why not?  This is a problem with a workaround, and no more critical than issues that happen on other server platforms that have been in the wild for years.  W2k8 R2 was RTM on August 14, 2009.  It is not like it is a pre-release version.  There is no reason to wait for a shrink-wrapped box for a product that has hit the VL and is fully supported by MS.  Performance alone is a reason to want to use it.

    Any applicable fixes for problems show up in Windows Update, just like any other supported product.

  • Re: PDF Download Problems with IIS7

    Oct 18, 2009 11:14 PM|joseph.ferris|LINK

     

    Toby.Considine

    I have to ask a simple question - do you have mime-types properly set up for PDF? Sometimes browsers are clever enough to figure out small files even if the mime types are not set, but choke on doing the same for large files.

    Yes, MIME type is received by the browser - using Firebug to watch the Net information.  Content size received from the server changes with each request - but for me that is because it is a linearized document (loaded over multiple parallel HTTP requests).

  • Re: PDF Download Problems with IIS7

    Oct 19, 2009 10:16 AM|JRArseneau|LINK

    Wow... Just wow.

    2008 R2 went RTM August 15, has been available in the Volume licensing channel and now, 2 months later, this issue is still present.

    How is it acceptable that Microsoft has not released a fix yet? I could understand if it was some obscure issue, but we're talking about a fundamental problem with the way IIS7.5 handles PDF files. PDF, widely used almost everywhere, needs to work.

    I'm shocked that there hasn't been a fix for this yet and as for using a different server for a workaround, I find that unacceptable.

     

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Oct 19, 2009 05:10 PM|Rovastar|LINK

    Fair enough I didn't realise it had been so long but it is still in the infancy of this OS. I am too surprised that MS haven't fixed this yet I don't understand what coudl be so different in IIS7.5/Win2008r2 to make this sucha  showstopper.

    joseph.ferris

    Why not?  This is a problem with a workaround, and no more critical than issues that happen on other server platforms that have been in the wild for years.  W2k8 R2 was RTM on August 14, 2009.  It is not like it is a pre-release version.  There is no reason to wait for a shrink-wrapped box for a product that has hit the VL and is fully supported by MS.  Performance alone is a reason to want to use it.

    Any applicable fixes for problems show up in Windows Update, just like any other supported product.

     
    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Oct 22, 2009 02:36 PM|Peter Buelens|LINK

    I can confirm this problem with IIS7 on Windows 2008 R2. We have exactly the same issues with PDF files

  • Re: PDF Download Problems with IIS7

    Oct 22, 2009 02:51 PM|lionel schiepers|LINK

    Hi,

    We have migrated a website running on windows 2003 servers to servers running Windows 2008R2 64bits today and we have exactly the same problem. It's really strange that an OS server could become gold with a webserver were you can't even publish pdf files. Even if the bug concerns acrobat reader, it works with all other web server (apache, iis 5, iis 6, iis 7 ...).

     I tried downloading the pdf files from a linux client (debian 5.0) and it works meaning the culpit it probably acrobat reader but even if adobe publishes a fix for iis 7.5, it's impossible for us to ask to our clients (bank companies, real estate companies ...) to update the acrobat reader installed on their computer to use the latest version. It's even more difficult to explain that they can't download documents from our web sites because their pdf clients is buggy but it works for all other web site they consult ?!?).

     

    It's definitively impossible to switch to a web server running Windows 2008 R2 until the web server can't transmit the data to acrobat reader.

     

     

    Lionel Schiepers

    ls at bvdep dot com

    Bureau van Dijk Electronic Publishing

    Windows IIS 7.5 2008 accept-ranges bytes r2 acrobat reader blocks

  • Re: PDF Download Problems with IIS7

    Oct 22, 2009 03:24 PM|lionel schiepers|LINK

     I've created this post on the adobe support web site:

    http://forums.adobe.com/thread/510857

     

    Hopping it will help to find a solution.

     

     

    Lionel Schiepers.

     

    adobe support iis 7.5

  • Re: PDF Download Problems with IIS7

    Oct 22, 2009 04:27 PM|lionel schiepers|LINK

    I hope it will take less time than apple to resolve the guest account problem that wipe all your profile data.... )-:

     

    As a work around, you can use your playstation 3 to read the pdf files. It's even faster than Windows 7 to boot and connect to the Internet ;-))

     

     

     

     

     

    playstation 3

  • Re: PDF Download Problems with IIS7

    Oct 26, 2009 11:35 AM|t.a.King|LINK

    Here's the official word on what the problem is, from MS tech support:

    In IIS7.5 we have implemented an optimization code that handles especially byte-ranges request whose result is a single range as follows.
     
    When a client makes a request of byte-ranges whose result is a single range, IIS 7.5 does not include the media type in the response! This seems to break Adobe-reader add-on in IE.
     
    In IIS7 and below we treated byte-ranges requests whose result is a single range the same manner as byte-ranges requests whose result is NOT a single range meaning that we all the time sent a media type in the response header.
     
    Example:
     
    The below request:
     
    Command: GET
      + URI: /test.pdf
       ProtocolVersion: HTTP/1.1
       Accept:  */*
       Range: bytes=153572-186237, 748935-750373, 748238-748934, 186238-411153, 750374-750792, 411154-486125, 486126-748237


     
    Is equivalent to making a request to range 153572 - 750792

     IIS7 will respond with
     
    - Http: Response, HTTP/1.1, Status Code = 206, URL: /test.pdf
       ProtocolVersion: HTTP/1.1
       StatusCode: 206, Partial content
       Reason: Partial Content
       ContentType: multipart/byteranges; boundary=<q1w2e3r4t5y6u7i8o9p0zaxscdvfbgnhmjklkl>


     
    IIS 7.5 will respond with
       ProtocolVersion: HTTP/1.1
       StatusCode: 206, Partial content
       Reason: Partial Content
       ContentType: application/pdf


     
    So in the case of IIS7.5, it is just like we are responding to a single range request “153572 - 750792 “  in which the HTTP RFC says that you should NOT send a media type in the response header!
     
    The IIS 7 and IIS7.5 behavior are both HTTP RFC compliant 
      
    A response to a request for a single range MUST NOT be sent using the
       multipart/byteranges media type.  A response to a request for
       multiple ranges, whose result is a single range, MAY be sent as a
       multipart/byteranges media type with one part. A client that cannot
       decode a multipart/byteranges message MUST NOT ask for multiple
       byte-ranges in a single request.

     

  • Re: PDF Download Problems with IIS7

    Oct 26, 2009 11:42 AM|JRArseneau|LINK

    All well and good, at least now I understand what the problem is..

    Did tech support also mention how they were going to fix it?

  • Re: PDF Download Problems with IIS7

    Oct 26, 2009 05:26 PM|t.a.King|LINK

    Adobe was finally able to recreate the problem on Friday, and they are supposed to be working on it.  (I don't know what their issue was with not being able to recreate it, but I did find out over the weekend that the behavior is different if the client you are using to browse the website is in a remote desktop session - everything seems to work fine.)

    Not sure what IIS Core team is doing, if anything.  Even if Adobe provides a patch, I'm not too sure about using 2008 r2 as public web server if it requires the client to have the latest and greatest plugin.  Microsoft may have the letter of the law on their side regards the RFC, but sometimes being right just isn't enough.

  • Re: PDF Download Problems with IIS7

    Oct 26, 2009 05:53 PM|lionel schiepers|LINK

    Hello everybody,

    Too tired to try it today but this article seems interesting to publish PDF file via a selfmade httphandler.

    The sample code contains a RangeRequestHandlerBase class  that can do byte serving meaning the background download of acrobat reader should still work. The solution of just streaming pdf files is not the best way for large file because you can't scroll in the document until the data are loaded from the server.

     

    http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx


    Lionel Schiepers

    Bureau van Dijk Electronic Publishing

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Oct 27, 2009 02:13 PM|Rovastar|LINK

    t.a.King

    Not sure what IIS Core team is doing, if anything.  Even if Adobe provides a patch, I'm not too sure about using 2008 r2 as public web server if it requires the client to have the latest and greatest plugin.  Microsoft may have the letter of the law on their side regards the RFC, but sometimes being right just isn't enough.

     

    I understand that but it is a non-microsoft client extension that you are serving and it is read by a non-microsoft client that is not following RFC standards.

    Do you think any patch that MS release should be windows update one for an important functional/security especially as it would break RFCs? I imagine with adobe they could have a hotfix coming out for this.

    Mods this post been marked as answered when clearly it is still an issue can we change this. ;)

    lionel schiepers

    Hello everybody,

    Too tired to try it today but this article seems interesting to publish PDF file via a selfmade httphandler.

    The sample code contains a RangeRequestHandlerBase class  that can do byte serving meaning the background download of acrobat reader should still work. The solution of just streaming pdf files is not the best way for large file because you can't scroll in the document until the data are loaded from the server.

     

    http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx


    Lionel Schiepers

    Bureau van Dijk Electronic Publishing


    Nice sounding workaround :) Thanks ofr the info.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Oct 27, 2009 03:29 PM|anthonymking|LINK

    t.a.King

    So in the case of IIS7.5, it is just like we are responding to a single range request “153572 - 750792 “  in which the HTTP RFC says that you should NOT send a media type in the response header!
     
    The IIS 7 and IIS7.5 behavior are both HTTP RFC compliant 

    Here is the problem I have with the Microsoft response;

    The client did not make a single range request. I think it is a bit disingenuous to say "we responded correctly to a single range request" when the client did not make a single range request. The client actually made a multi-range request and the server "optimized" it into a single range request. That's like me asking your for blue paint, and you give me red paint and argue that it is perfect red paint. I don't care how perfect the red is, I asked for blue.

  • Re: PDF Download Problems with IIS7

    Oct 30, 2009 05:26 PM|gyrator|LINK

    anthonymking

    That's like me asking your for blue paint, and you give me red paint and argue that it is perfect red paint. I don't care how perfect the red is, I asked for blue.
     

    It is nothing like that. It is more like the client asking for five 1-gallon buckets of blue paint and the server giving you one 5-gallon bucket of blue paint. And if you read the response from MS tech support...

    A response to a request for multiple ranges, whose result is a single range, MAY be sent as a multipart/byteranges media type with one part.

    I read the emphasis on MAY as implying that it is optional and the alternative would be to treat it as a single byte range and handle it accordingly...

    A response to a request for a single range MUST NOT be sent using the multipart/byteranges media type.

    And it appears this is what they've done in IIS 7.5.

  • Re: PDF Download Problems with IIS7

    Oct 30, 2009 07:39 PM|t.a.King|LINK

    More news from MS Tech Support.  This is regards Adobe's side of the problem:

    "Great news from Adobe!
    "They have worked on the issue and they recognized it is a bug in the reader! They have logged the bug and they will work on releasing a fix in the next Adobe reader release. They have no ETA as to when the next release will be."

    So this doesn't address being able to run 2008 r2 as a web server at all.  Someday Adobe will issue a release, and someday the majority of the population will have it installed.

    With regard to Microsoft's side of the issue:

    "I am still pushing however for a server solution even with this news, I don’t have an ETA as to when our product team will decide if they are going to take a fix for that or not, but I’ll keep you posted."

    It doesn't matter if it's red paint or one 5-gallon bucket of paint; if Microsoft doesn't do any change, anybody serving PDFs from a web site or web app will need to write code to handle the PDF requests or else not upgrade their web server to Windows Server 2008 r2.  In the short term, Adobe's fix probably isn't going to be enough of a solution.  Personally, I'd prefer the OS code to remain "pristine" and RFC-compliant, but in the real world, I've got a web site that needs to serve PDFs to a public that's not always so good about updating their plugins. 

    Okay...to be honest....I've already written the code to handle the PDFs and am about to move it to production.  I'll leave it to others to debate who is being RFC compliant and who is not and does it matter.....

  • Re: PDF Download Problems with IIS7

    Oct 31, 2009 02:06 PM|Peter Buelens|LINK

    Would you be so kind to share your code with us please? I know Lionel is working on this too as we work at the same company ;-)

  • Re: PDF Download Problems with IIS7

    Nov 05, 2009 12:07 PM|wshackne|LINK

    We would love to get the httpHandler if someone else has already developed it. It looks like we might have to implement this ourselves as it stands and it seems silly for a whole bunch of people to develop on on their own.  Thanks!

  • Is it possible to disable byte range request in IIS?

    Nov 05, 2009 05:44 PM|lionel schiepers|LINK

    Hi,

    It's 100 days that the bits of W2K8R2 are gold and RTM and it's still not possible to publish PDF documents for adobe reader. As usual, it's not possible to use a Microsoft OS until the first service pack isn't it? I don't even understand why the workstation and the server were delivered at the same time, the server was usualy published few months later than the workstation and this permitted to fix the latest issues found in the workstation for the server release.

    As a workaroond, does someone know if it's at least possible to disable the possibility to request byte-ranges to IIS 7.5 ? This would solve the problem that adobe reader blocks reading blocks of data.

     Lionel Schiepers.

  • Re: Is it possible to disable byte range request in IIS?

    Nov 05, 2009 05:57 PM|anilr|LINK

    No, it is not possible to disable byte-range processing for files served by the static file handler.  It has been less than 30 days since we became aware of this problem, the speed of a fix is dependent on the the number and impact on the people hitting it, the only way to increase the priority on the hotfix is to call product support so we have a better idea on how many people are hitting this.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: Is it possible to disable byte range request in IIS?

    Nov 05, 2009 07:49 PM|Rovastar|LINK

    That may be true Anil but surely if this is 100% reproducable (is it?) then you can help equate the seriousness of any problems. It is a problem if you only react to the product support calls and the volumes of calls as the primary measure of seriousness.

    I am not using Windows 2008 r2/iis 7.5 at the moment but currently I would not recommend it as a consultant capacity because of this issue that is a showstopper to many. Like others have said pdf is a fairly common web file type. I am not going to raise a product call for this yet I want a solution.

     

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: Is it possible to disable byte range request in IIS?

    Nov 06, 2009 10:37 AM|wshackne|LINK

    Am I right in understanding that we are supposed to pay a couple hundred dollars to open a support ticket with Microsoft so that they are convinced that this is a serious issue?   That is kind of a hard sell. 

  • Re: Is it possible to disable byte range request in IIS?

    Nov 06, 2009 11:22 AM|Peter Buelens|LINK

    We could maybe start spreading the word and make people around the world aware that they should not upgrade. Loosing sales might convince microsoft too...

  • Re: Is it possible to disable byte range request in IIS?

    Nov 06, 2009 12:23 PM|anilr|LINK

    You do not have to open a support case to get the fix - the fix is already being worked on.  If the fix is urgent for you and has a significant business impact on you, opening a support case is likely to get you the fix sooner.  Also, note that support costs are refunded for any cases that result in a bug fix.

    Anil Ruia
    Software Design Engineer
    IIS Core Server
  • Re: Is it possible to disable byte range request in IIS?

    Nov 06, 2009 12:56 PM|lionel schiepers|LINK

    You were saying in a previous post that adobe admited that it was a bug on their side in adobe reader. If it's true, that means the fix won't be a bug fix because the current implementation respect the RFC standard. That proves that you will never be refunded for this case because the fix will not correct a bug in the implementation.

     

    I think that this fix is very urgent and would be available ASAP but it should be pushed on Windows update as an optional update too.

     

    I hope that Microsoft will update its check list before releasing a new operation system and test if their web server works with the most common document format in use. Apparently, it's only possible to publish docx documents but who uses this format for internet????

     

    We decided to rollback our installation down to W2K3 and I don't think that we will let any more chance to W2K8R2 until the first service pack is released. Probably 2H2010?

     

    Anil, despit this problem, I appreciate your rapid feedback. Thanks.

    Lionel Schiepers.


  • Re: Is it possible to disable byte range request in IIS?

    Nov 06, 2009 01:02 PM|lionel schiepers|LINK

    In reply to Peter,

    I have already posted a message on 25 different forums yesterday ;-) Sometimes on threads releated to this problem.


  • Re: Is it possible to disable byte range request in IIS?

    Nov 10, 2009 03:57 PM|merk|LINK

    please add me to the list of people complaining about this. requiring all users to download an update from adobe to fix this is beyond ridiculous. This was working on previous versions of windows server so it makes no sense at all that MS would change it to the point of breaking functionality.

    Has anyone already come across a fix for this that works?

    http://dotnetslackers.com/articles/aspnet/Range-Specific-Requests-in-ASP-NET.aspx

    I'm looking at that article - i have one question - how could i implement this server wide instead of individually adding the dll to each website and updating each sites web.config?

    thanks
  • Re: Is it possible to disable byte range request in IIS?

    Nov 11, 2009 01:22 PM|merk|LINK

    Has anyone gotten this working using the suggested fix from the dotnetslakers article? I compiled a modified version of that handler to deal with the PDF files but I'm not sure i set it up in IIS correctly.

    How would i get PDF files handled by the asp.net handler and then processed by my class? I believe i followed all the steps needed. My Web.config looks like this:

     <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
      <modules>
        <add name="Exceptioneer" preCondition="managedHandler" type="Exceptioneer.WebClient.ClientModule, Exceptioneer.WebClient" />
      </modules>
      <handlers>
                <add name="ASPX-PDF" path="*.pdf" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
      <add name="PDFDownloadHandler" verb="*" path="*.pdf" type="PDFDownloadHandler" preCondition="integratedMode" />
      </handlers>
      
        </system.webServer> 

    But the system behaves the same as far as pdf's are concerned.

  • Re: Is it possible to disable byte range request in IIS?

    Nov 11, 2009 01:35 PM|lionel schiepers|LINK

    merk

    Has anyone gotten this working using the suggested fix from the dotnetslakers article? I compiled a modified version of that handler to deal with the PDF files but I'm not sure i set it up in IIS correctly.

    How would i get PDF files handled by the asp.net handler and then processed by my class? I believe i followed all the steps needed. My Web.config looks like this:

     <system.webServer>
      <validation validateIntegratedModeConfiguration="false" />
      <modules>
        <add name="Exceptioneer" preCondition="managedHandler" type="Exceptioneer.WebClient.ClientModule, Exceptioneer.WebClient" />
      </modules>
      <handlers>
                <add name="ASPX-PDF" path="*.pdf" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
      <add name="PDFDownloadHandler" verb="*" path="*.pdf" type="PDFDownloadHandler" preCondition="integratedMode" />
      </handlers>
      
        </system.webServer> 

    But the system behaves the same as far as pdf's are concerned.

     

     

    I didn't try it but are you working with an application pool configured in integrated mode or classical mode?

     

    Lionel Schiepers

  • Re: Is it possible to disable byte range request in IIS?

    Nov 11, 2009 01:46 PM|merk|LINK

    its integrated mode
  • Re: PDF Download Problems with IIS7

    Nov 11, 2009 05:50 PM|tryniski|LINK

    I have also migrated from 2003 server to 2008r2 Over the week end and had the same problem.... my mail box was  filled up from unhappy  people who cound not open up PDF files from my site...I average just under 3,000,000 hits a month and only server pdf files, this problem needs to have a fix on the server side......From the reading here its clear an Adoby problem but the problems of getting so many people to up date their Acrobat plugin Is not a smooth approcach for the users and a major head ach for the site operators ..... I have had no choice but to go back to the 2003 server and only hope for a server side fix very quickly.......

  • Re: Is it possible to disable byte range request in IIS?

    Nov 11, 2009 11:22 PM|sk123|LINK

    merk, I wasn't able to get the dotnetslackers one to work either the pdf files still seemed to have the issue. I did some more research and found a few articles on how to use HTTP Handlers and came up with something that seems to work, on my machine at least. Sorry for any code formatting issue I wasn't sure the best way to post it.

    My system.webServer section looks like this:
    <handlers>
    <
    add name="PDFDownloadHandler" verb="*" path="*.pdf" type="IIS7PDFDownloadHandler" preCondition="integratedMode"/>
    </
    handlers>

    And code is as follows:
    Imports System
    Imports System.Web
    Imports System.IO
    Imports System.Web.SessionState

    Public Class IIS7PDFDownloadHandler
    Implements IHttpHandler

    Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
    Get
    Return False
    End Get
    End Property

    Public Sub ProcessRequest(ByVal context As HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
    Select Case context.Request.HttpMethod
    Case "GET"
    If file.exists(context.Server.MapPath(context.Request.FilePath)) Then
    Dim requestedFile As String = context.Server.MapPath(context.Request.FilePath)
    SendContentTypeAndFile(context, requestedFile)
    Else
    context.response.statuscode = 404
    End If
    Case Else
    context.response.statuscode = 404
    End Select
    End Sub

    Private Function SendContentTypeAndFile(ByVal context As HttpContext, ByVal strFile As String) As HttpContext
    context.Response.ContentType =
    "application/pdf"
    context.Response.TransmitFile(strFile)
    context.Response.end()
    Return context
    End Function

    End Class

  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 02:19 AM|merk|LINK

    sk123 - thanks for posting that. So you just compiled that into a dll, dropped in the bin folder and edited the web.config - nothing else? I'll give this a try and let you know if it resolved it.
  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 02:37 AM|merk|LINK

    a very big thanks. I just tried this out and it seems to be working for me as well. Thank you very much.
  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 03:57 AM|lionel schiepers|LINK

    merk

    a very big thanks. I just tried this out and it seems to be working for me as well. Thank you very much.
     

     

    Thanks for this workaround too!

    This solution is different than dotnetslackers because it doesn't support byte range request meaning that you can't scroll in big pdf files (i.e: 50MB+) until the data are loaded. I think that it's not necessary for many usages and this is certainly fastest to implement than reinstalling a web server under IIS 7 or lower!

     

    Thanks,

    Lionel Schiepers.

     

     

  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 08:18 AM|JRArseneau|LINK

    Anyone mind layout out a few procedures on how to implement this properly? I'm having a few issues, and I'm also uncertain if this fix only works within ASP applications or if you can attribute it server-wide?
  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 12:24 PM|namtab00|LINK

     I haven't been able to get it working.

     I'm on Win2008 SP2 IIS7.0 integrated mode apppool.

     Translated the code to C# like this:


    using System;
    using System.IO;
    using System.Web;
    using System.Web.SessionState;

    namespace Company.Windows.IIS.Handlers
    {
        public class IIS7PDFDownloadHandler : IHttpHandler
        {
            public bool IsReusable
            {
                get
                {
                    return false;
                }
            }


            public void ProcessRequest(HttpContext context)
            {
                switch (context.Request.HttpMethod)
                {
                    case "GET":
                        {
                            if (File.Exists(context.Server.MapPath(context.Request.FilePath)))
                            {
                                context.Response.ContentType = "application/pdf";
                                context.Response.TransmitFile(context.Server.MapPath(context.Request.FilePath));
                                context.Response.End();
                            }
                            else
                            {
                                context.Response.StatusCode = 404;
                            }
                            break;
                        }
                    default:
                        {
                            context.Response.StatusCode = 404;
                            break;
                        }
                }
            }
        }
    }

    anybody got any clues?

    This is totally absurd, we're talking about PDF's here people... It's not rocket surgery..

    Windows 2008 iis 7 Windows 2008 IIS 7 PDF download problem

  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 12:36 PM|sk123|LINK

    namtab00, just a quick thought...you did register the handler in your web.config right? Also you said you are running on Win08 SP2 IIS 7.0 I thought this issue was only with Win08 R2 running IIS 7.5 but maybe I'm wrong?

  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 01:04 PM|merk|LINK

    if anyone wants, I'll post the dll that i compiled from sk123's code. Then all you have to do is drop it in your websites BIN folder and make the appropriate entry in the web.config (or do it through the IIS admin panel). I'm going to try adding it to the server as a whole in a little while so that i dont have to do it on a site by site basis.
  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 01:23 PM|namtab00|LINK

     Of course I set the web.config file...

     I have the same problem on Win2008 SP2 IIS7.0 .. PDF's won't load, IE8 hangs, Firefox works.

    Adobre Reader 9.2

  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 01:27 PM|sk123|LINK

    merk, let me know if you find a way to add it server wide. I have not had time to look into it today due to other projects so if you find it first please share! :)

  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 06:03 PM|wshackne|LINK

     Yeah...I would love to see get the compiled DLL, it would sure save some time!

  • Re: Is it possible to disable byte range request in IIS?

    Nov 12, 2009 06:29 PM|merk|LINK

    ok, i uploaded here:

    http://www.mediafire.com/file/0zjkugzjvcy/PDFHandler2.zip

    3 files in the zip - the dll, the xml and the pdb

    EDIT: i updated the dll so that it's signed and re-uploaded the zip here: http://www.mediafire.com/file/twrd2mnzm3y/PDFHandler2.zip
  • PDF Handler - Server Wide

    Nov 12, 2009 07:21 PM|sk123|LINK

    I was able to get this to work server wide. What I did was compiled the code into a DLL then installed the DLL into the Global Assembly Cache and then went into the IIS 7 Home screen, clicked Handler Mappings Add Managed Handler. Then for request path I put *.pdf from the Type drop down located the DLL I added into the GAC gave it a name of PDF-Fix.

  • Re: PDF Handler - Server Wide

    Nov 12, 2009 07:24 PM|merk|LINK

    how do you add it to the GAC? I thought we use gacutil to do that but i could not find that in the framework folder.
  • Re: PDF Handler - Server Wide

    Nov 12, 2009 07:37 PM|sk123|LINK

    I used the VS 2008 Command Prompt to run it, but can you copy and paste the DLL into the C:\Windows\Assembly folder?

  • Re: PDF Handler - Server Wide

    Nov 12, 2009 07:51 PM|merk|LINK

    I didn't think that would work - i thought you had to do something to actually register the dll. I guess i can give that a try when i get home.
  • Re: PDF Handler - Server Wide

    Nov 12, 2009 08:04 PM|sk123|LINK

    I just removed it from my GAC then dragged and dropped the dll from the source location into the assembly folder and it showed it back in the list of assemblies in the GAC. I was of course logged in as Administrator.

  • Re: PDF Handler - Server Wide

    Nov 12, 2009 09:06 PM|merk|LINK

    wow - who would have thought the easiest and most obvious way of adding it to the GAC would actually work :) thanks
  • Re: PDF Handler - Server Wide

    Nov 13, 2009 05:46 AM|namtab00|LINK

     I dunno what kind of GAC you kids have, but mine accepts only strongly named assemblies... So no can do for the DLL posted.

    Anyone else experiencing the IE8 hang when requesting a PDF from the IIS7 webserver?

     Are we all using the latest (9.2) Adobe Reader?

  • Re: PDF Handler - Server Wide

    Nov 13, 2009 07:59 AM|sk123|LINK

    Not sure about the dll merk posted but I compiled my own using the code I posted and signed it and put her in the GAC and worked fine. Maybe you should try to compile the code yourself to ensure it is signed.

  • Re: PDF Handler - Server Wide

    Nov 13, 2009 08:02 AM|sk123|LINK

    I am running Adobe Reader 9.2.0, before the PDFHandler IE 8 would sometimes work but most of the times not and Firefox would never work. After the PDFHandler, IE 8 and Firefox have worked every time.

  • Re: PDF Handler - Server Wide

    Nov 13, 2009 08:58 AM|wshackne|LINK

     Yep...I got the "Strongly Typed" error that namtab00 got as well.  I am running 2008 Web R2 64.  I am downloading Visual Studio 2008 right now so I can compile it.

  • Re: PDF Handler - Server Wide

    Nov 13, 2009 09:08 AM|sk123|LINK

    I don't have the files on this computer or I'd upload. Once I can get back to my laptop I will upload the DLL I compiled so you can try unless someone else uploads before I can.

  • Re: PDF Handler - Server Wide

    Nov 13, 2009 09:47 AM|wshackne|LINK

     I just had one of my developers create a strongly named assembly.  We got it into the GAC without a hitch.  You can get it at http://www.mediafire.com/?2ngqgwzzmzn

    So, here is what I did to get it working:

    1. Copied IIS7PDFDownloadHandler.dll into the c:\windows\assembly folder
    2. In IIS Manager selected the Home screed root web server (NS2) and then clicked on Handler Mappings
    3. Clicked "Add managed handler."  
    4. In Request Path used "*.pdf"  Selected DLL in Type and for name put "IIS7PDFDownloadHander"
    5. Clicked "Request Restriction" and gave it execute access.

    That is it!  Tested and it works like a champ!

    Now...if only Microsoft would fix IIS 7.5.  Good luck with that one.

     

     

    S

  • Re: PDF Download Problems with IIS7

    Nov 13, 2009 11:29 AM|miler1600|LINK

    Here is the modified code of the dotnet slackers that I got working to resolve multi byte request:  There were a few issues with the original code.  Keep in mind I have modified this to only work with pdf mime types.  You could easily change that back.

    using System;

    using System.Collections.Generic;

    using System.Collections.Specialized;

    using System.IO;

    using System.Linq;

    using System.Security.Cryptography;

    using System.Text;

    using System.Web;

    namespace Water.Handlers

    {

    public class PDFDownloadHandler2 : IHttpHandler

    {

    #region Constants

    private const string MULTIPART_BOUNDARY = "THIS_STRING_SEPARATES";

    private const string MULTIPART_CONTENTTYPE = "multipart/byteranges; boundary=" + MULTIPART_BOUNDARY;

    private const string DEFAULT_CONTENTTYPE = "application/pdf";

    private const string HTTP_HEADER_ACCEPT_RANGES = "Accept-Ranges";

    private const string HTTP_HEADER_ACCEPT_RANGES_BYTES = "bytes";

    private const string HTTP_HEADER_ACCEPT_RANGES_NONE = "none";

    private const string HTTP_HEADER_CONTENT_TYPE = "Content-Type";

    private const string HTTP_HEADER_CONTENT_RANGE = "Content-Range";

    private const string HTTP_HEADER_CONTENT_LENGTH = "Content-Length";

    private const string HTTP_HEADER_ENTITY_TAG = "ETag";

    private const string HTTP_HEADER_LAST_MODIFIED = "Last-Modified";

    private const string HTTP_HEADER_RANGE = "Range";

    private const string HTTP_HEADER_IF_RANGE = "If-Range";

    private const string HTTP_HEADER_IF_MATCH = "If-Match";

    private const string HTTP_HEADER_IF_NONE_MATCH = "If-None-Match";

    private const string HTTP_HEADER_IF_MODIFIED_SINCE = "If-Modified-Since";

    private const string HTTP_HEADER_IF_UNMODIFIED_SINCE = "If-Unmodified-Since";

    private const string HTTP_HEADER_UNLESS_MODIFIED_SINCE = "Unless-Modified-Since";

    private const string HTTP_METHOD_GET = "GET";

    private const string HTTP_METHOD_HEAD = "HEAD";

    private const int DEBUGGING_SLEEP_TIME = 0;

    #endregion

    #region
    Constructorpublic PDFDownloadHandler2()

    {

    this.ProcessRequestCheckSteps =

    new Func<HttpContext, bool>[]

    {

    CheckAuthorizationRules,

    CheckHttpMethod,

    CheckFileRequested,

    CheckRangesRequested,

    CheckIfModifiedSinceHeader,

    CheckIfUnmodifiedSinceHeader,

    CheckIfMatchHeader,

    CheckIfNoneMatchHeader,

    CheckIfRangeHeader

    };

    }

    #endregion

    #region
    Properties

    /// <summary>

    /// Indicates if the HTTP request is for multiple ranges.

    /// </summary>

    public bool IsMultipartRequest { get; private set; }

    /// <summary>

    /// Indicates if the HTTP request is for one or more ranges.

    /// </summary>

    public bool IsRangeRequest { get; private set; }

    /// <summary>

    /// The start byte(s) for the requested range(s).

    /// </summary>

    public long[] StartRangeBytes { get; private set; }

    /// <summary>

    /// The end byte(s) for the requested range(s).

    /// </summary>

    public long[] EndRangeBytes { get; private set; }

    /// <summary>

    /// The size of each chunk of data streamed back to the client.

    /// </summary>

    /// <remarks>

    /// When a client makes a range request the requested file's contents are

    /// read in BufferSize chunks, with each chunk flushed to the output stream

    /// until the requested byte range has been read.

    /// </remarks>

    public virtual int BufferSize { get { return 25000; } }

    /// <summary>

    /// Indicates the path to the log file that records HTTP request and response headers.

    /// </summary>

    /// <remarks>

    /// The log is only enabled when the application is executing in Debug mode.

    /// </remarks>

    public virtual string LogFileName { get { return "~/ResumableFileDownloadHandler.log"; } }

    /// <summary>

    /// Indicates whether Range requests are enabled. If false, the HTTP Handler

    /// ignores the Range HTTP Header and returns the entire contents.

    /// </summary>

    public virtual bool EnableRangeRequests { get { return true; } }

    public bool IsReusable { get { return false; } }

    private Func<HttpContext, bool>[] ProcessRequestCheckSteps { get; set; }

    private FileInfo InternalRequestedFileInfo { get; set; }

    private string InternalRequestedFileEntityTag { get; set; }

    private string InternalRequestedFileMimeType { get; set; }

    private NameValueCollection InternalResponseHeaders = new NameValueCollection();

    #endregion

    #region
    Methods

    /// <summary>

    /// Returns a FileInfo object representing the requested content.

    /// </summary>

    public FileInfo GetRequestedFileInfo(HttpContext context)

    {

    if (File.Exists(context.Request.PhysicalPath))

    return new FileInfo(context.Request.PhysicalPath);

    else

    return null;

    }

    /// <summary>

    /// Returns the Entity Tag (ETag) for the requested content.

    /// </summary>

    /// <remarks>

    /// The Entity Tag is computed by taking the physical path to the file, concatenating it with the

    /// file's created date and time, and computing the MD5 hash of that string.

    ///

    /// A derived class MAY override this method to return an Entity Tag

    /// value computed using an alternate approach.

    /// </remarks>

    public virtual string GetRequestedFileEntityTag(HttpContext context)

    {

    FileInfo requestedFile = this.GetRequestedFileInfo(context);

    if (requestedFile == null)

    return string.Empty;

    ASCIIEncoding ascii = new ASCIIEncoding();

    byte[] sourceBytes = ascii.GetBytes(string.Concat(

    requestedFile.FullName,

    "|",

    requestedFile.LastWriteTimeUtc

    )

    );

    return Convert.ToBase64String(new MD5CryptoServiceProvider().ComputeHash(sourceBytes));

    }

    /// <summary>

    /// Returns the MIME type for the requested content.

    /// </summary>

    /// <remarks>

    /// A dervied class SHOULD override this method and return the MIME type specific

    /// to the requested content. See http://www.iana.org/assignments/media-types/ for

    /// a list of MIME types registered with the Internet Assigned Numbers Authority (IANA).

    /// </remarks>

    public virtual string GetRequestedFileMimeType(HttpContext context)

    {

    return DEFAULT_CONTENTTYPE;

    }

    public void ProcessRequest(HttpContext context)

    {

    context.Response.Clear();

    context.Response.ClearHeaders();

    context.Response.ContentType =
    "application/pdf";

    this.InternalRequestedFileInfo = this.GetRequestedFileInfo(context);

    this.InternalRequestedFileEntityTag = this.GetRequestedFileEntityTag(context);

    this.InternalRequestedFileMimeType = this.GetRequestedFileMimeType(context);

    // Parse the Range header (if it exists), populating the StartRangeBytes and EndRangeBytes arrays

    ParseRequestHeaderRanges(context);

    // Perform each check; exit if any check returns false

    foreach (var check in ProcessRequestCheckSteps)if (check(context) == false)

    {

    return;

    }

    // Checks passed, process request!

    if (!this.EnableRangeRequests || !this.IsRangeRequest)

    ReturnEntireEntity(context);

    else

    ReturnPartialEntity(context);

    }

    private void ReturnEntireEntity(HttpContext context)

    {

    try

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    Response.StatusCode = 200; // OK

    WriteCommonResponseHeaders(Response, this.InternalRequestedFileInfo.Length, this.InternalRequestedFileMimeType);

     

    if (Request.HttpMethod.Equals(HTTP_METHOD_HEAD) == false)Response.TransmitFile(this.InternalRequestedFileInfo.FullName);

    Response.Flush();

    context.Response.End();

    HttpContext.Current.ApplicationInstance.CompleteRequest();WaterContext.Current.Context.Server.ClearError();

    }

    catch (Exception ex)

    {

    HttpContext.Current.ApplicationInstance.CompleteRequest();

    WaterContext.Current.Context.Server.ClearError();

    }

    }

    private void ReturnPartialEntity(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    Response.StatusCode = 206; // Partial response

    // Specify the byte range being returned for non-multipart requests

    if (this.IsMultipartRequest == false)

    AddHeader(Response, HTTP_HEADER_CONTENT_RANGE,

    string.Format("bytes {0}-{1}/{2}",

    this.StartRangeBytes[0].ToString(),

    this.EndRangeBytes[0].ToString(),this.InternalRequestedFileInfo.Length.ToString()

    )

    );

    WriteCommonResponseHeaders(Response,

    ComputeContentLength(),

    this.IsMultipartRequest ? MULTIPART_CONTENTTYPE : this.InternalRequestedFileMimeType);if (Request.HttpMethod.Equals(HTTP_METHOD_HEAD) == false)

    ReturnChunkedResponse(context);

    }

    private void ReturnChunkedResponse(HttpContext context)

    {

     

    HttpResponse Response = context.Response;

    byte[] buffer = new byte[this.BufferSize];

    using (FileStream fs = this.InternalRequestedFileInfo.OpenRead())

    {

    for (int i = 0; i < this.StartRangeBytes.Length; i++)

    {

    // Position the stream at the starting byte

    fs.Seek(this.StartRangeBytes[i], SeekOrigin.Begin);

    int bytesToReadRemaining = Convert.ToInt32(this.EndRangeBytes[i] - this.StartRangeBytes[i]) + 1;

    // Output multipart boundary, if needed

    if (this.IsMultipartRequest)

    {

    Response.Output.WriteLine(
    "--" + MULTIPART_BOUNDARY);

    Response.Output.WriteLine(string.Format("{0}: {1}", HTTP_HEADER_CONTENT_TYPE, "application/pdf"));

    Response.Output.WriteLine(string.Format("{0}: bytes {1}-{2}/{3}",

    HTTP_HEADER_CONTENT_RANGE,

    this.StartRangeBytes[i].ToString(),

    this.EndRangeBytes[i].ToString(),

    this.InternalRequestedFileInfo.Length.ToString()

    )

    );

    Response.Output.WriteLine();

    }

    Response.Flush();

     

    // Stream out the requested chunks for the current range request

     

    while (bytesToReadRemaining > 0)

    {

    if (Response.IsClientConnected)

    {

    int chunkSize = fs.Read(buffer, 0, this.BufferSize < bytesToReadRemaining ? buffer.Length : bytesToReadRemaining);

    Response.OutputStream.Write(buffer, 0, chunkSize);

    bytesToReadRemaining -= chunkSize;

    buffer =
    new byte[this.BufferSize];

    Response.Flush();

    }

    else

    {

    // Client disconnected - quit

    return;

    }

    }

    if (this.IsMultipartRequest)

    Response.Output.WriteLine();

    }

    fs.Close();

    }

    if (this.IsMultipartRequest)

     

    {

    // In multipart responses, close the response once more with

    // the boundary and line breaks

    Response.Output.WriteLine("--" + MULTIPART_BOUNDARY + "--");

    Response.Output.WriteLine();

    }

    Response.End();

    HttpContext.Current.ApplicationInstance.CompleteRequest();WaterContext.Current.Context.Server.ClearError();

    }

    private int ComputeContentLength()

    {

    int contentLength = 0;

    for (int i = 0; i < this.StartRangeBytes.Length; i++)

    {

    contentLength +=
    Convert.ToInt32(this.EndRangeBytes[i] - this.StartRangeBytes[i]) + 1;if (this.IsMultipartRequest)

    contentLength += MULTIPART_BOUNDARY.Length

    + this.InternalRequestedFileMimeType.Length

    + this.StartRangeBytes[i].ToString().Length

    + this.EndRangeBytes[i].ToString().Length

    + this.InternalRequestedFileInfo.Length.ToString().Length

    + 49; // Length needed for multipart header

    }

    if (this.IsMultipartRequest)

    contentLength += MULTIPART_BOUNDARY.Length

    + 8; // Length of dash and line break

    return contentLength;

    }

    private void WriteCommonResponseHeaders(HttpResponse Response, long contentLength, string contentType)

    {

    //AddHeader(Response, HTTP_HEADER_CONTENT_LENGTH, contentLength.ToString());

    AddHeader(Response, HTTP_HEADER_CONTENT_TYPE, contentType);

    AddHeader(Response, HTTP_HEADER_LAST_MODIFIED,
    this.InternalRequestedFileInfo.LastWriteTimeUtc.ToString("r"));

    //AddHeader(Response, HTTP_HEADER_ENTITY_TAG, string.Concat("\"", this.InternalRequestedFileEntityTag, "\""));

    //if (this.EnableRangeRequests)

    // AddHeader(Response, HTTP_HEADER_ACCEPT_RANGES, HTTP_HEADER_ACCEPT_RANGES_BYTES);

    // else

    // AddHeader(Response, HTTP_HEADER_ACCEPT_RANGES, HTTP_HEADER_ACCEPT_RANGES_NONE);

    }

    private string RetrieveHeader(HttpRequest Request, string headerName, string defaultValue)

    {

    return string.IsNullOrEmpty(Request.Headers[headerName]) ? defaultValue : Request.Headers[headerName].Replace("\"", string.Empty);

    }

    protected virtual void ParseRequestHeaderRanges(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    string rangeHeader = RetrieveHeader(Request, HTTP_HEADER_RANGE, string.Empty);if (string.IsNullOrEmpty(rangeHeader))

    {

    // No Range HTTP Header supplied; send back entire contents

    this.StartRangeBytes = new long[] { 0 };

    this.EndRangeBytes = new long[] { this.InternalRequestedFileInfo.Length-1 };

    this.IsRangeRequest = false;this.IsMultipartRequest = false;

    }

    else

    {

    // rangeHeader contains the value of the Range HTTP Header and can have values like:

    // Range: bytes=0-1 * Get bytes 0 and 1, inclusive

    // Range: bytes=0-500 * Get bytes 0 to 500 (the first 501 bytes), inclusive

    // Range: bytes=400-1000 * Get bytes 500 to 1000 (501 bytes in total), inclusive

    // Range: bytes=-200 * Get the last 200 bytes

    // Range: bytes=500- * Get all bytes from byte 500 to the end

    //

    // Can also have multiple ranges delimited by commas, as in:

    // Range: bytes=0-500,600-1000 * Get bytes 0-500 (the first 501 bytes), inclusive plus bytes 600-1000 (401 bytes) inclusive

    // Remove "Ranges" and break up the ranges

    string[] ranges = rangeHeader.Replace("bytes=", string.Empty).Split(",".ToCharArray());

    this.StartRangeBytes = new long[ranges.Length];

    this.EndRangeBytes = new long[ranges.Length];

    this.IsRangeRequest = true;

    this.IsMultipartRequest = true;for (int i = 0; i < ranges.Length; i++)

    {

    const int START = 0, END = 1;

    // Get the START and END values for the current range

    string[] currentRange = ranges[i].Split("-".ToCharArray());

    if (string.IsNullOrEmpty(currentRange[END]))

    // No end specified

    this.EndRangeBytes[i] = this.InternalRequestedFileInfo.Length - 1;

    else

    // An end was specified

    this.EndRangeBytes[i] = long.Parse(currentRange[END]);if (string.IsNullOrEmpty(currentRange[START]))

    {

    // No beginning specified, get last n bytes of file

    this.StartRangeBytes[i] = (this.InternalRequestedFileInfo.Length - 1) - this.EndRangeBytes[i];this.EndRangeBytes[i] = this.InternalRequestedFileInfo.Length - 1;

    }

    else

    {

    // A normal begin value

    this.StartRangeBytes[i] = long.Parse(currentRange[0]);

    }

     

    }

    }

    }

    /// <summary>

    /// Adds an HTTP Response Header

    /// </summary>

    /// <remarks>

    /// This method is used to store the Response Headers in a private, member variable,

    /// InternalResponseHeaders, so that the Response Headers may be accesed in the

    /// LogResponseHttpHeaders method, if needed. The Response.Headers property can only

    /// be accessed directly when using IIS 7's Integrated Pipeline mode. This workaround

    /// permits logging of Response Headers when using Classic mode or a web server other

    /// than IIS 7.

    /// </remarks>

    protected void AddHeader(HttpResponse Response, string name, string value)

    {

    InternalResponseHeaders.Add(name, value);

    Response.AddHeader(name, value);

    }

    #region Process Request Step Checksprotected virtual bool CheckAuthorizationRules(HttpContext context)

    {

    // Any authorization checks should be implemented in the derived class

    return true;

    }

    protected virtual bool CheckHttpMethod(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    if (!Request.HttpMethod.Equals(HTTP_METHOD_GET) &&

    !Request.HttpMethod.Equals(HTTP_METHOD_HEAD))

    {

    Response.StatusCode = 501; // Not Implemented

    return false;

    }

    return true;

    }

    protected virtual bool CheckFileRequested(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    if (this.InternalRequestedFileInfo == null)

    {

    Response.StatusCode = 404; // Not Found

    return false;

    }

    if (this.InternalRequestedFileInfo.Length > int.MaxValue)

    {

    Response.StatusCode = 413; // Request Entity Too Large

    return false;

    }

    return true;

    }

    protected virtual bool CheckRangesRequested(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    return true;for (int i = 0; i < this.StartRangeBytes.Length; i++)

    {

    if (this.StartRangeBytes[i] > (this.InternalRequestedFileInfo.Length - 1) ||

    this.EndRangeBytes[i] > (this.InternalRequestedFileInfo.Length - 1))

    {

    context.Response.StatusCode = 400; // Bad Request

    return false;

    }

    if (this.StartRangeBytes[i] < 0 || this.EndRangeBytes[i] < 0)

    {

    context.Response.StatusCode = 400; // Bad Request

    return false;

    }

    if (this.EndRangeBytes[i] < this.StartRangeBytes[i])

    {

    context.Response.StatusCode = 400; // Bad Request

    return false;

    }

    }

    return true;

    }

    protected virtual bool CheckIfModifiedSinceHeader(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    string ifModifiedSinceHeader = RetrieveHeader(Request, HTTP_HEADER_IF_MODIFIED_SINCE, string.Empty);if (!string.IsNullOrEmpty(ifModifiedSinceHeader))

    {

    // Determine the date

    DateTime ifModifiedSinceDate;

    DateTime.TryParse(ifModifiedSinceHeader, out ifModifiedSinceDate);

    if (ifModifiedSinceDate == DateTime.MinValue)

    // Could not parse date... do not continue on with check

    return true;

    DateTime requestedFileModifiedDate = this.InternalRequestedFileInfo.LastWriteTimeUtc;

    requestedFileModifiedDate = new DateTime(

    requestedFileModifiedDate.Year,

    requestedFileModifiedDate.Month,

    requestedFileModifiedDate.Day,

    requestedFileModifiedDate.Hour,

    requestedFileModifiedDate.Minute,

    requestedFileModifiedDate.Second

    );

    ifModifiedSinceDate = ifModifiedSinceDate.ToUniversalTime();

    if (requestedFileModifiedDate <= ifModifiedSinceDate)

    {

    // File was created before specified date

    Response.StatusCode = 304; // Not Modified

    return false;

    }

    }

    return true;

    }

    protected virtual bool CheckIfUnmodifiedSinceHeader(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    string ifUnmodifiedSinceHeader = RetrieveHeader(Request, HTTP_HEADER_IF_UNMODIFIED_SINCE, string.Empty);

    if (string.IsNullOrEmpty(ifUnmodifiedSinceHeader))

    // Look for Unless-Modified-Since header

    ifUnmodifiedSinceHeader = RetrieveHeader(Request, HTTP_HEADER_UNLESS_MODIFIED_SINCE, string.Empty);if (!string.IsNullOrEmpty(ifUnmodifiedSinceHeader))

    {

    // Determine the date

    DateTime ifUnmodifiedSinceDate;

    DateTime.TryParse(ifUnmodifiedSinceHeader, out ifUnmodifiedSinceDate);

    DateTime requestedFileModifiedDate = this.InternalRequestedFileInfo.LastWriteTimeUtc;requestedFileModifiedDate = new DateTime(

    requestedFileModifiedDate.Year,

    requestedFileModifiedDate.Month,

    requestedFileModifiedDate.Day,

    requestedFileModifiedDate.Hour,

    requestedFileModifiedDate.Minute,

    requestedFileModifiedDate.Second

    );

    if (ifUnmodifiedSinceDate != DateTime.MinValue)

    ifUnmodifiedSinceDate = ifUnmodifiedSinceDate.ToUniversalTime();

    if (requestedFileModifiedDate > ifUnmodifiedSinceDate)

    {

    // Could not convert value into date or file was created after specified date

    Response.StatusCode = 412; // Precondition failed

    return false;

    }

    }

    return true;

    }

    protected virtual bool CheckIfMatchHeader(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    string ifMatchHeader = RetrieveHeader(Request, HTTP_HEADER_IF_MATCH, string.Empty);

    if (string.IsNullOrEmpty(ifMatchHeader) || ifMatchHeader == "*")

    return true; // Match found

    // Look for a matching ETag value in ifMatchHeader

    string[] entityIds = ifMatchHeader.Replace("bytes=", string.Empty).Split(",".ToCharArray());foreach (string entityId in entityIds)

    {

    if (this.InternalRequestedFileEntityTag == entityId)

    return true; // Match found

    }

    // If we reach here, no match found

    Response.StatusCode = 412; // Precondition failed

    return false;

    }

    protected virtual bool CheckIfNoneMatchHeader(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    string ifNoneMatchHeader = RetrieveHeader(Request, HTTP_HEADER_IF_NONE_MATCH, string.Empty);

    if (string.IsNullOrEmpty(ifNoneMatchHeader))

    return true;if (ifNoneMatchHeader == "*")

    {

    // Logically invalid request

    Response.StatusCode = 412; // Precondition failed

    return false;

    }

    // Look for a matching ETag value in ifNoneMatchHeader

    string[] entityIds = ifNoneMatchHeader.Replace("bytes=", string.Empty).Split(",".ToCharArray());foreach (string entityId in entityIds)

    {

    if (this.InternalRequestedFileEntityTag == entityId)

    {

    AddHeader(Response, HTTP_HEADER_ENTITY_TAG, string.Concat("\"", entityId, "\""));

    Response.StatusCode = 304; // Not modified

    return false; // Match found

    }

    }

    // No match found

    return true;

    }

    protected virtual bool CheckIfRangeHeader(HttpContext context)

    {

    HttpRequest Request = context.Request;

    HttpResponse Response = context.Response;

    string ifRangeHeader = RetrieveHeader(Request, HTTP_HEADER_IF_RANGE, this.InternalRequestedFileEntityTag);if (this.IsRangeRequest && ifRangeHeader != this.InternalRequestedFileEntityTag)

    {

    ReturnEntireEntity(context);

    return false;

    }

    return true;

    }

    #endregion

    #endregion

    }

    }

  • Re: PDF Download Problems with IIS7

    Nov 13, 2009 01:32 PM|namtab00|LINK

     Can someone confirm having the same issue on IIS7.0 , Win2008 (SP2)... as in NOT IIS 7.5 Win2008 R2 ?

    I seem to be the only one around with this version and perhaps I don't have the same problem.
    My symptoms are a bit different:
    - with IE (7 or 8 with Adobe Reader 9.2) while requesting a PDF from the webserver the browser just hangs, causes 100% usage of a CPU core; only way to recover is killing iexplore.exe, needless to say the PDF never gets to the client
    - with Firefox everything runs smooth as silk, but then again the extensions API is a whole different story
    - tried every posted solution, nothing works (tried with both classic and integrated apppool mode; I kinda need classic mode in order to support a 3rd party control..)

    If someone, ANYONE, has any knowledge of any kind of a different issue involving PDF's and IIS 7.0, please make yourself heard.

    Thanks.

  • Re: PDF Download Problems with IIS7

    Nov 13, 2009 02:12 PM|merk|LINK

    apologies that the dll i posted didn't work. I had not tried adding it to the GAC when i posted that. I had only added it to a single site, which did work. namtab00 - can you confirm that the problem you are having happens with other users and not just yourself? To me it sounds more like an issue with your PC then the server.
  • Re: PDF Download Problems with IIS7

    Nov 16, 2009 03:49 AM|namtab00|LINK

     I confirm that the s**t has hit the fan.... On my client I open every PDF on planet Earth except those served by my shiny, new and utterly useless Win2008 SP2 IIS7.0 webserver.
    Tried all posted HTTP handlers, applied at the server/website/virtual dir levels (independently and together).

    I am >< this close to buying "PHP and Apache for Dummies"....

  • Re: PDF Download Problems with IIS7

    Nov 16, 2009 05:49 AM|namtab00|LINK

     UPDATE:

    I have just found out that my web server has the same problem with *.doc files.
    At this point I am REALLY worried... I may have done something terribly wrong, maybe Adobe Reader's bug is not my main problem..

    I've checked MIME types and they're OK...

    Does anyone have some advice as to where should I start looking?

    Main symptom: all links to PDF's and doc files causes client IE to hang. IIS logs says 200 OK.

    HEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEELP!

    :D

    EDIT: Hmmmmm... Doc files don't work in Terminal Session but they DO work from the client (YES, Office is installed everywhere).... I'm completely disoriented... Boss is breathing down my neck...  Anyone got a job opening?

    Anyone can explain to me howcome Firefox's Adobe Reader plugin manages to request and render the PDF with no problem whatsoever? The base modules that send the HTTP request are theorically the some, be it IE or FF... or not? I must be missing some long-lost switch somewhere....

  • Re: PDF Download Problems with IIS7

    Nov 16, 2009 12:38 PM|anthonymking|LINK

    namtab00

    I have just found out that my web server has the same problem with *.doc files.
    At this point I am REALLY worried... I may have done something terribly wrong, maybe Adobe Reader's bug is not my main problem..

     

    The bug being discussed in this thread is unlikely to be your problem. Lots and lots of people are successfully serving PDF files from server 2008 R1. I recommend that you create a new thread. Unfortunately, the title of this thread should have referred to IIS 7.5 instead of 7.0.

  • Re: PDF Download Problems with IIS7

    Nov 16, 2009 04:51 PM|lionel schiepers|LINK

     Come on Microsoft,

     

    When will you say "yes we can ... be compatible with PDF files that exists since yearsssssssss..."

     

     

  • Re: PDF Download Problems with IIS7

    Nov 19, 2009 04:47 PM|bdenglish|LINK

    Has anyone made any progress on this?  We used some of the VB code referenced earlier in the thread and have had some success in writing the handler.

    Basically if you use IE, we are getting 100% of our pdfs served it appears.  However if you use firefox the results are varied.  It seems that consistantly the first time i load click the link the first time the TransferFile stops.  if i close it and do it again, it comes up fine.  I can make it open 3 times in a row then it starts failing again randomly.

     The only mods i have made to the vb code earlier in the thread are:

    Private Function SendContentTypeAndFile(ByRef context As HttpContext, ByVal strFile As String) As HttpContext

    context.Response.ClearContent()

    context.Response.ClearHeaders()

    'context.Response.Clear()

    Dim pdfInfo As FileInfo = New FileInfo(strFile)

    context.Response.AddHeader("Content-Length", pdfInfo.Length.ToString())

    context.Response.ContentType = "application/pdf"

    'context.Response.TransmitFile(strFile)

    context.Response.WriteFile(strFile)

    context.Response.End()

    'context.ApplicationInstance.CompleteRequest()

    context.Server.ClearError()

    Return context

    End Function

    If anyone can shed a little light on this WE WOULD APPRECIATE IT!!! 

    Thanks

  • Re: PDF Download Problems with IIS7

    Nov 30, 2009 06:48 AM|Alesh_77|LINK

    I have exactly the same problem... is there a solution yet??? I am hosting 15 web pages with lots of PDF - one page is actually an online library with over 800 PDF files ... I cannot believe this.. IE opens most of files, FF and Chrome open none.. this is frustrating...

     ANY SOLUTION AVAILABLE???

  • Re: PDF Download Problems with IIS7

    Nov 30, 2009 09:18 AM|namtab|LINK

     Can any of you out there having this issue be really gentle and try serving a .doc file using the same identical logic?

    I'm posting on a different thread because I'm on Win2008 SP2 IIS7.0. My problem seems suspiciously similar to yours, added that I cannot serve neither .pdf nor .doc files.

    It's been almost a month now that I've been hunting for a solution, tried every posted workaround and still no luck.

    Thanks in advance to whoever proves himself/herself kind enough to lend a hand

  • Re: PDF Download Problems with IIS7

    Nov 30, 2009 09:38 AM|Alesh_77|LINK

    I seem to have no problems serving .doc files .. I have Standard Server 2008 R2, IIS7.5.

    On some PCs PDF files open ok in IE and/or Firefox, on some not ... I cannot find any pattern on client computers .. so this must be a IIS issue. I cannot believe Microsoft did nothing to help you guys for one month?!? This is unbelievable ...

  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 09:24 AM|namtab|LINK

    I know what you're about to read will probably seem impossible, but still hear me out...

    I'm gonna specify one more time my config:

    <div style="margin-left: 40px;">Win2008 R1 SP2, IIS 7.0, integrated apppool, ASP.NET 3.5 SP1 with Classic ASP enabled, all 20+ clients I've tested use IE8
    </div>

    Issue:

    <div style="margin-left: 40px;">PDFs (and later tried .doc) not loading client side, IE8 hangs, hogs one CPU core until its process killed
    </div>


    I've spend the bigger chunk of today commenting out sections of my web.config, clearing client cache, refreshing, killing iexplorer.exe by the hundreds in an effort to isolate the offending bit.
    Turns out its this little sucker, which didn't even cross my mind:


    <configuration>
    <system.webServer>
    <httpProtocol>
                <customHeaders>
                    <clear/>
                    <add name="X-UA-Compatible" value="IE=edge"/>
                </customHeaders>
            </httpProtocol>
    </system.webServer>
    </configuration>

    I know for sure that shouldn't cause trouble.  Just for the sake of trying, I changed from "edge" to "8", but the issue persisted.
    To me it doesn't make any sense, IMHO IE8 should ignore the header on MIME  types other than x/html..

    All I can say removing that customHeader from the web.config fixed the problem in my case. I checked the compatibility mode default behaviour and it should stick with DOCTYPEs.

    If someone outthere has a logical explanation to this little puzzle, do take the time to enlighten me if you may.

     

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Dec 01, 2009 11:28 AM|Rovastar|LINK

     

    Alesh_77

    I have exactly the same problem... is there a solution yet??? I am hosting 15 web pages with lots of PDF - one page is actually an online library with over 800 PDF files ... I cannot believe this.. IE opens most of files, FF and Chrome open none.. this is frustrating...

     ANY SOLUTION AVAILABLE???

    This thread has been dragging on hasn't it......:(

    I am not sure if I asked this already but can you access the pdfs if firefox is installed on the serve via localhost.

    e.g. is it just local to IIS compement or something more to do with Windows 2008 R2 OS and when it send it out beyond the http.sys


    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 03:18 PM|Stussyredhat|LINK

    I have just tested by installing firefox and reader on server and I get the same problem. To confirm I am running Windows Server 2008 R2 I have issues seeing PDF's in Firefox, Chrome and IE 6. I have tried the PDF handler and it seems to work sometimes. I am getting this error in the event view also since I installed the DLL in the GAC. System - Provider [ Name] ASP.NET 2.0.50727.0 - EventID 1334 [ Qualifiers] 49152 Level 2 Task 0 Keywords 0x80000000000000 - TimeCreated [ SystemTime] 2009-12-01T20:10:27.000000000Z EventRecordID 12898 Channel Application Computer XXXXXXX Security - EventData An error occurred during a process host idle check. Exception: System.AccessViolationException Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. StackTrace: at System.Collections.Hashtable.GetEnumerator() at System.Web.Hosting.ApplicationManager.IsIdle() at System.Web.Hosting.ProcessHost.IsIdle()
  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Dec 01, 2009 03:34 PM|Rovastar|LINK

    Ok it was a long shot anyway. Thanks for testing. Just trying to get make sure where the problem lies in order to get a solution.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 03:45 PM|Stussyredhat|LINK

    I have open a case with Microsoft and am on the phone as I type this I will let you know.
  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 04:11 PM|merk|LINK

    if MS has an official fix for this, I would love to know. Please do post back what the results are after you are off the phone with MS. Thanks!
  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 05:50 PM|Stussyredhat|LINK

    Ok I am starting to get some answers, it has to do with the byte range as stated before. So far the rep has stated that if I want to fix this server wide I need to make a http module that removes the "if-range" from all incoming requests. I am not sure off all details and am waiting for a response from the rep. I will post more info as I get it.
  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 06:06 PM|merk|LINK

    This isn't aimed at you since i know this isn't your fault. But i think it's complete garbage that MS is saying we need to make a module. As far as i am concerned, they are the ones that broke this. It was working under IIS6 and IIS7.0 and stopped working under IIS7.5 - i think it's insane for them not to just post some sort of hotfix that corrects this especially considering how prevalent PDF use is.

    I hope they are at least not making you pay for the call.
  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 06:08 PM|merk|LINK

    and i hope they at least aren't making you pay for the call
  • Re: PDF Download Problems with IIS7

    Dec 01, 2009 11:07 PM|Stussyredhat|LINK

    Thats a benefit of having a Technet subscription I get 2 incidents.
  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 12:32 AM|merk|LINK

    you shouldn't have to use any of them in my opinion since i consider this to be a bug on MS's side of things.
  • Never trust Microsoft when they release a new operating system!

    Dec 02, 2009 03:46 PM|lionel schiepers|LINK

    Microsoft is aware of this problem since at least 21 september 2009 (72 days old) and still no correction yet.

     

    1.  Microsoft should have detected this problem before W2K8R2 being gold in august.

    2. The time to have a fix to this show stopper problem is a good indication of the quality of the code of IIS.

    3. The best alternative to solve this problem is downgrading your OS down to W2K3 and never trust Microsoft when they release a new operating system. You still have to wait for at least the first service pack, even in the 21st century!

     It remembers me this bug in the .NET Framework http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=95566 that I have posted in 2005 and it's still not corrected.

     Lionel Schiepers.

  • Re: Never trust Microsoft when they release a new operating system!

    Dec 02, 2009 03:54 PM|lionel schiepers|LINK

     There is not even a QFE available after more than 2 months.

     

  • Re: Never trust Microsoft when they release a new operating system!

    Dec 02, 2009 03:57 PM|lionel schiepers|LINK

    Two more posts and there will be 100 items in this thread. How many items before Microsoft acknowledge this is urgent for many peoples?

     

  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 04:16 PM|merk|LINK

    StussyRedHat - did you hear anything further back from MS regarding a fix for this?
  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 05:27 PM|Stussyredhat|LINK

    Well this doesnt sound good. I just talked to someone on the escalation team and he explained what the problem was. Basically it isn't a problem with IIS 7.5 or with the browser, it is with the adobe plugin and how it is handling the byte range requests. He said that they are working on a hotfix.  I asked when the hotfix will be avaiable and he said it will take some time and said it could be as far out as February. I am on the list to get the hotfix when they have one to test.

     As a solution he asked if I had a IIS 7 server or below to host the PDF's on so I could use a URL rewrite with a rule that says if a request has a .pdf extension in it redirect to another url on a diffrent server Below are the links to the URL rewrite.

    http://www.iis.net/expand/URLRewrite

    http://learn.iis.net/page.aspx/460/using-url-rewrite-module/ 

    I know that this doen't sound like a good answer from Microsoft but at least it is a answer. You are always taking a chance by adopting a new operating system right out of the gate.

     I have decided to use the PDF handler dll since it works most of the time and will wait untill the hotfix. I will post anything new that I hear.

  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 05:52 PM|merk|LINK

    Thanks for the update StussyRedHat. I'd like to know from MS how they can say this is a problem with adobe when using all the same software, except NOT using IIS 7.5 the download works. Seems like a cop-out answer from MS to me. thanks for letting us know what they said. I think i'll do the same as you and use the pdf handler.
  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 06:15 PM|Stussyredhat|LINK

    Here is the technical information. I got from the Rep.
     
    In IIS7.5 we have implemented an optimization code that handles especially byte-ranges request whose result is a single range request (called Merged requests)as follows.
     
    When a client makes a request of byte-ranges whose result is a single range, IIS does not include the media type in the response! This seems to break Adobe-reader add-on.
     
    In IIS7 and below we treated byte-ranges requests whose result is a single range the same manner as byte-ranges requests whose result is NOT a single range meaning that we all the time sent a media type in the response header.
     
    Example:
     
    The below request:
     
    Command: GET
      + URI: /test..pdf
       ProtocolVersion: HTTP/1.1
       Accept:  */*
       Range: bytes=153572-186237, 748935-750373, 748238-748934, 186238-411153, 750374-750792, 411154-486125, 486126-748237


     
    Is equivalent to making a request to range 153572 - 750792

     
    IIS7 will respond with
     
    - Http: Response, HTTP/1.1, Status Code = 206, URL: /Brochure.CDC.h1n1_take3.pdf
       ProtocolVersion: HTTP/1.1
       StatusCode: 206, Partial content
       Reason: Partial Content
       ContentType: multipart/byteranges; boundary=<q1w2e3r4t5y6u7i8o9p0zaxscdvfbgnhmjklkl>


     
    IIS 7.5 will respond with
        
    ProtocolVersion: HTTP/1.1
       StatusCode: 206, Partial content
       Reason: Partial Content
       ContentType: application/pdf


     
    So in the case of IIS7.5, it is just like we are responding to a single range request “
    153572 - 750792 “  in which the HTTP RFC says that you should NOT send a media type in the response header.
     
    The IIS7.5 behavior change is HTTP RFC compliant

     
     
    A response to a request for a single range MUST NOT be sent using the
       multipart/byteranges media type.  A response to a request for
       multiple ranges,
    whose result is a single range
    , MAY be sent as a
       multipart/byteranges media type with one part. A client that cannot
       decode a multipart/byteranges message MUST NOT ask for multiple
       byte-ranges in a single request.

     As we discussed, this does not seem to be an issue with IIS, but rather with Adobe Reader. We have worked with them and they have confirmed that this is a bug in their code and that they will be fixing it. However since we cannot guarantee that the fix that they will be releasing could be on any client browser, we have been asked officially  by Adobe to look into a server solution.  
     

    This DCR (Design Change Request) had been approved and we are working now into a solution.

  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 06:30 PM|merk|LINK

    Leave it to MS to decide to conform more fully with standards and that winds up breaking something ;)

    I guess MS isn't 100% at fault here. But seriously - the bottom line is they made a change and something broke. Something i dont think is inconsequential either. I would have hoped they could have come out with a fix by now. Ideally, something we could turn on/off.

    Thanks again for posting the info from MS
  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 07:44 PM|steve schofield|LINK

    There is a couple posts blasting MS.  I agree PDF is a popular format people use, however it's not a MS standard nor a 'open' standard.  It's an adopted standard by business and users.  The other angle is why doesn't PDF become more standard and work with multiple web servers, browsers.  The thing if someone wants to use IIS 7 for integrated pipeline, modular architecture and ASP.NET as a 1st class citizan, it could be a trade off or remain on a prior platform.    Heck, even have a separate farm that is running something else to service up PDF so they don't go through IIS.   A sub-domain would work here.  There are workarounds if you really want.  This reminds if of a spat between MS and Novell a few years back.  Anywho, I'm glad the IIS team is providing the platform and between modules such as URL Rewrite, AAR and other things.  Spend your time on that if time is slim.  My 2 cents.   Keep up the good work.  Hopefully they'll get this worked out soon, I'm confident they will.

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: PDF Download Problems with IIS7

    Dec 02, 2009 09:47 PM|bdenglish|LINK

    Hey guys,

    Most of our sites are Dotnet Nuke sites.  We have noticed that If you use the built in DNN file linking, the pdfs open in Chrome and firefox fine.  In the same site, if you link using the normal href=www.website.com/filename.pdf it still doesnt work.  I have been working on a handler (i posted the code a while back), and as it stands, sometimes my files open in firefox, sometimes they dont.  I have not figured that out yet...  But since it appears the guys at Dotnet nuke have a working solution I have been trying to apply this method to my HTTPHandler.  Just thought i would put it out there, in case anyone else wants to take a stab at it.  The method that seems to work in all browsers is the linkclick which can be found in Dotnetnuke.Library.Services.Filesystem.Fileserverhandler.vb and some other points of interest are Dotnetnuke.Library.Utilities.FileSystemUtils.vb. 

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Dec 03, 2009 05:52 AM|Rovastar|LINK

    steve schofield

    There is a couple posts blasting MS.  I agree PDF is a popular format people use, however it's not a MS standard nor a 'open' standard.  It's an adopted standard by business and users.  The other angle is why doesn't PDF become more standard and work with multiple web servers, browsers.  The thing if someone wants to use IIS 7 for integrated pipeline, modular architecture and ASP.NET as a 1st class citizan, it could be a trade off or remain on a prior platform.    Heck, even have a separate farm that is running something else to service up PDF so they don't go through IIS.   A sub-domain would work here.  There are workarounds if you really want.  This reminds if of a spat between MS and Novell a few years back.  Anywho, I'm glad the IIS team is providing the platform and between modules such as URL Rewrite, AAR and other things.  Spend your time on that if time is slim.  My 2 cents.   Keep up the good work.  Hopefully they'll get this worked out soon, I'm confident they will.

     

    Sorry Steve, I see this as a copout answer. 

    I understand the problem but this still doesn't help me and others. I just looked at this thread today as I'm at a major global outsourcer consulting for at the moment I am recommending on IIS web technology architecture for future projects. At this stage I have to say don't use Windows 2008 R2/IIS 7.5. And this is a main issue (the only other thing of note is the lack of .NET 1.1 support but now we are beginning to class that as a legacy component).

    PDfs are *very* popular up there with other components like flash. Many, many sites will have a pdf documents on them. Although it is not an open standard or owned by MS web servers serve an array of content not just MS stuff. We have to support the whatever the sites can send out and a multitude of browsers, etc.

    Some large setups with a lot of pdf content might have a dedicated pdf server resource but they have to be served via some web server software. Also why mix the technologies?

    Also there are plenty of setups that do not warrant a separate pdf server farm. There could be a large site over multiple server farms and tiers which as a minor part of the site servers pdf file press releases with little traffic for these files. I could not just justify recommend a separate pdf server for this and I do not know who would.

    So for advising on a policy for what version of 2008 to use I need to know if there are ANY pdf files on the site. 

    This is not a great advert for migrating to the latest technology (which is what MS as a company want people to do). I want to recommend the latest technology but cannot.

    Next year I expect many sites to migrate to 2008 x/IIS 7.x most people will not know the difference between the 2008 and 2008 R2 and the problems that can occur from it.

    I understand that adobe are not being RFC compliant (and now MS are) and should make an update but what about the millions and millions of people that have not updated. Even if an update from the adobe side is out there it will years before all the users have on their machines.

    Why when a new change like this is made in the IIS can there not be registry flag to change to revert to old behaviour? That is what I want to see.

    I appreciate all the additional features that the IIS team have been doing like the ARR and the multitude of modules that have been coming out. They are truly useful. However I in recent time a repeated "It's not our fault" answer strictly speaking MS are correct but that doesn't help anyone and timescales for these fixes seem huge; 2 and half months already and another 2 months or so for a 'at your own risk' hotfix.

    I don't want to be accused of bashing Microsoft here I am just surprised at the nonchalant attitude perceived about this issue. No real information has been posted here from MS the best information has been from users who relay information from the MS support desk.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Dec 03, 2009 06:02 AM|Peter Buelens|LINK

    I believe Rovastar is nicely stating the core problem. His advise NOT to install Windows Server 2008 R2 (should have been named Windows Server 7) but to use Windows Server 2008 instead is exactly my point of view too.

  • Re: PDF Download Problems with IIS7

    Dec 03, 2009 06:18 AM|steve schofield|LINK

    Nicely stated.  The point I was trying to get across people get emotional at times stating it's an MS problem.  It comes down to evaluating what is best for the business, and evaluating if the product fits their needs.  W2k8 and w2k8 r2 (probably incorrectly named).  w2k8 / iis 7 was a huge step forward.   w2k8 r2 and iis 7.5 are a incremental step with some benefits on other things outside the web.  The warmup item is a biggie, but can be worked around through other processes.  The thing is if a site has a huge requirement like serving PDF's, then they could do a workaround until it's available to integrate into the main architecture.  I've seen cases such as 'static content aka images' and 'media' farms that helped separate content and assist with performance on higher volume sites. 

    There was a post by Anil about they are investigating a bug.  It comes down to the customer and evaluating the latest technology.  You are correct, MS seems to "push" or more like "shove" the latest and greatest technology on people.  They are a business wanting people to purchase new.  A side note, I feel for the developer crowd out there trying to keep up with the technology.  You are "not cool" if you don't use the latest technology.  

    I probably used the wrong term "bashing".  I'm glad people speak freely, it gets the IIS Teams attention that this is a big deal.  I believe they'll respond with a timely and correct answer.  Sounds like the fix is in the works and is rather complicated.  They'll learn from this and move forward.  Appreciate the information on it.  It'll definitely help the community, which I believe we both agree is 'quite active'!

    PS - My thoughts of using w2k8r2 would be for more benefits such as Hyper-V, clustering and AD. The web role isn't a huge driving force to upgrade.  Most of the benefits are in w2k8 so if you upgrade strictly for r2, then you bumps like this could happen.  I'm still on w2k8 and we are evaluating w2k8r2. 

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: PDF Download Problems with IIS7

    Dec 03, 2009 06:18 AM|Alesh_77|LINK

    Can someone advise me what to do now - I have migrated 15 web pages for my customers to new Server 2008 R2 about 3 weeks ago. There are 1384 PDF files on this web pages ... I cannot migrate back to old server and just to think about moving just PDFs to another server and then to change all links to PDF files gives me a BIG headache ...

  • Re: PDF Download Problems with IIS7

    Dec 03, 2009 06:53 AM|steve schofield|LINK

    do you have a load-balancer that supports layer 5 which could do specific content types on another server?  That is one idea. 

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Dec 03, 2009 09:09 AM|Rovastar|LINK

    Yeah there are many differences between 2008 and 2008R2

    From my memory Windows 2003 to 2003R2 had new stuff but not all that much and nothing afaik for web admin/architects to be concerned about. From what I understand 20008r2 has a lot and after only a year or so in the first 2008 lifecycle. Most will see it like a new version with the service packs rolled in.

    Anyway there are changes many things in the core IIS components as hinted at in the version number change IIS 7.5. But we do not know what has changed, what more (if anything) will come out of the woodwork.

    Do we have to do the usual wait on a new windows OS to have a service pack or 2 before serious live production deployment. Do we have to wait for Windows 2008r2 sp2? I hope not. :(

    steve schofield

    PS - My thoughts of using w2k8r2 would be for more benefits such as Hyper-V, clustering and AD. The web role isn't a huge driving force to upgrade.  Most of the benefits are in w2k8 so if you upgrade strictly for r2, then you bumps like this could happen.  I'm still on w2k8 and we are evaluating w2k8r2. 

     

    I suppose I am looking at users of IIS 5 or 6 migrating to 7.x that is where I see a lot of the activiety in the future.

    I cannot see IIS7 to IIS7.5 migrations.

    There are plans now for future deployment from IIS 5/6 to 7.x 

    Should everyone migrating make it a IIS 7.0 deployment? And large scale deployments will take many months or years to do from VM evaluation stage to production deployment. I can't even recommend at the early stages use 2008R2 which I want to do for full production deployments in 9 months time. They will not upgrade again for many years until IIS 8 or beyond.

    Issues like this are showstoppers for many and I would think many others.

    Oh BTW can someone change the name of this thread to:

    PDF Download Problems with IIS7.5

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • My Windows 2003 rocks!

    Dec 03, 2009 05:10 PM|lionel schiepers|LINK

    Rovastar

    steve schofield

    There is a couple posts blasting MS.  I agree PDF is a popular format people use, however it's not a MS standard nor a 'open' standard.  It's an adopted standard by business and users.  The other angle is why doesn't PDF become more standard and work with multiple web servers, browsers.  The thing if someone wants to use IIS 7 for integrated pipeline, modular architecture and ASP.NET as a 1st class citizan, it could be a trade off or remain on a prior platform.    Heck, even have a separate farm that is running something else to service up PDF so they don't go through IIS.   A sub-domain would work here.  There are workarounds if you really want.  This reminds if of a spat between MS and Novell a few years back.  Anywho, I'm glad the IIS team is providing the platform and between modules such as URL Rewrite, AAR and other things.  Spend your time on that if time is slim.  My 2 cents.   Keep up the good work.  Hopefully they'll get this worked out soon, I'm confident they will.

     

    Sorry Steve, I see this as a copout answer. 

    I understand the problem but this still doesn't help me and others. I just looked at this thread today as I'm at a major global outsourcer consulting for at the moment I am recommending on IIS web technology architecture for future projects. At this stage I have to say don't use Windows 2008 R2/IIS 7.5. And this is a main issue (the only other thing of note is the lack of .NET 1.1 support but now we are beginning to class that as a legacy component).

    PDfs are *very* popular up there with other components like flash. Many, many sites will have a pdf documents on them. Although it is not an open standard or owned by MS web servers serve an array of content not just MS stuff. We have to support the whatever the sites can send out and a multitude of browsers, etc.

    ...

     

     

    This exactly resumes what I'm thinking about too.

     

    Secondly, I presume that steve schofield works at the marketing staff of microsoft ? ;-)

    From my point of view, I don't really see a revolution with IIS7.x, just an evolution. What's new?

    • Integrated pipeline? I think that the first web server providing an integrated pipeline was Cassini that evolved later as the web server provided with Visual Studio 2005 & later to debug web application, this was for the story. The main advantage of the integrated pipeline is that your .NET code directly communicates with the http layer (http.sys and other stuff) instead of being handled by an ISAPI filter. Is it a revolution?
    • URL Rewrite? There are many plug-ins on the web do it with IIS 5 & 6 & 7 & 7.5. I'm using this one for example: http://iirf.codeplex.com/
    • ARR? I tried it but I had many problems on web sites hosted on the same server. Does it mean it needs a dedicated server? If this is the case, there are better and more powerfull free alternatives like HAProxy ( http://haproxy.1wt.eu/ ). ARR only works for HTTP traffic.You can't load balance tcp connection for example.
    •  Componentized? One core installation that only takes more than 1GB to do nothing exepted displaying a console windows in a graphical user interface? euhhhh, this is the case since 30 years for all other OS (Unix, QNX, VMS ...)? DOS was doing that with only one floppy disc ;-)

     

    When I had the problem of PDF download, I reverted back the servers to W2K3R2 two days later because I was pretty sure that Microsoft won't publish a patch in a timely manner. I'm thinking about using Visual Studio 2010 in march 2010 but this bug remind me that you must never put in production a MS product until the first service pack.

     

     If the patch is really due for february 2010 (6 months after the RTM), a patch that will do what? Sending 6 chunks of data instead of 1 when you request 6 'contiguous' chunk of data? 6 months for that????

     

    W2K8 is great:

    Slower network connection until you run this command: Netsh interface tcp set global autotuning=disabled chimney=disabled rss=disabled (my SQL Server 2005 backup where 5x time faster over 1Gbps network line after this command)

    Flawed SMB 2.0 (advise from microsoft in sep 09, disable SMB 2.0 :-)

    IIS 7.5 unusable for this problem and still no knowledge base about this either on technet or support.microsoft.com.

    Since the PDC 2009, Microsoft is telling all the bad he thinks about Vista. W2K8 is just the server version with the same kernel....

     

    My Windows 2003 rocks!

    My Windows 2003 rocks!

  • Winows Azure

    Dec 03, 2009 05:26 PM|lionel schiepers|LINK

    Just one though about windows azure if someone plans to use it.

    I suppose that Windows Azure is or will not be composed of only one operating system. All OS upgrades won't be atomically applied the thousand of server nodes whihch means that you could have for example something like W2K8 & W2K8R2 at the same time in the farm. Could it be possible to have this problem with windows azure? I mean, you subscribe to a service and one time, Microsoft decides to upgrade the OS and your site doesn't work as before and replies you that it's not the problem of MS if adobe is not RFC compliant (please wait 6 months for a patch, until then, your site won't work any more). With Windows Azure, you don't have the control of the hosting environment. AMAZON EC2 is far better for this!

     Lionel.

  • Re: My Windows 2003 rocks!

    Dec 03, 2009 05:34 PM|steve schofield|LINK

    Stick with what works in your environment, from my perspective R2 is a minor if not an unnecessary upgrade if you are on w2k8 IIS 7, which I have been for years.  Sorry I don't have perspective with IIS 5 or 6, so I'll not speak for these situations.  Regardless if I was running NT 4.0, I would evaluate my application needs for my environment, understand the limitations and if something like this came up, I'd determine with the business if it was worth the workarounds and pains to stay on a older but stable version or get "the latest version".   

    This is EXACTLY why I like the community persepctive and discussion.  I won't blame the vendor for my lack of planning or preparation.  When a third party vendor, even PDF which is popular now.  In the past, it was 3rd party components for classic asp, java or some other ISAPI based program.  People need to be aware of their app, which is NOT MS's issue.   I posted a workaround either A changing the link or B) using a layer 5 type load-balancer which could service content.   MS has identified the bug and working on a workaround.  Seems no one is going after PDF for being non-standards complient.  :) 

    Lastly, this reminds me a lot of w2k3 R2, which had a killer feature called DFS.  There was probably some web stuff, but nothing worth upgrading.  This is the same as I see it.   

    Great discussion!

    Edit - Hehe!  I'm not part of the MS marketing team although you may wonder.  Maybe an IIS MVP yet, but I don't work for MS.  I have a point to speak up where sometimes the community can to bring an independent perspective.  I don't think for PC reasons MS can come out and really say what they feel. I won't even try to speak for them.  You are correct on the tcp off-load (the entire SNP stack) is worthless.  Besides UAC, I turn this off on servers.   I always tell those who are spirited if you don't like MS products, go to LAMP.   It all depends on the business needs. :))

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: My Windows 2003 rocks!

    Dec 03, 2009 05:47 PM|merk|LINK

    Steve, sounds like you are making excuses for MS to me. I'll agree that MS isn't 100% at fault here. but the fact remains that something that was working on IIS7 no longer works on IIS7.5.

    What do you consider to be the more practical solution - tweak something in IIS7.5 to get it working again or tell millions of people to go download the updated adobe reader? From another perspective - we paid money to MS for IIS7.5 - we don't pay money to adobe.

    If nothing else, as Lionel pointed out, there should at least be something on technet or msdn or support etc acknowledging this bug. I think it's a bit unfair to put the onus on the user to be aware of all the undocumented problems in an MS product that MS is aware of but doesn't publicly acknowledge in any of their official support channels.

    Community perspective and discussion is GREAT. No arguments from me about that. But in this situation, with something they have been aware of for a while now, this shouldn't be the only way for someone to find out about the problem. There should be a KB article on this by now IMHO even if they dont have a fix yet.
  • Re: My Windows 2003 rocks!

    Dec 03, 2009 07:15 PM|steve schofield|LINK

    Maybe I'm being thick headed.  I'm not making excuses as much as pointing out the original flame was DO NOT USE MS until first SP.  It irks me a little when people blame a vendor w/o doing their own planning and work. This feature should be called out although for years MS was blasted for not being standards complient, then when they do, people bark. :)  Can't win either way.  

    As far as not paying for Abobe, hmm I wonder why Adobe gives away PDF reader, they make $$.  And yes PDF is my favorite format.  Would you expect millions of IIS people to change or PDF users.  Well, I would worry about my customers and how they would be impacted.  I don't support the entire Internnet.  Planning is something over looked. 

    I agree MS was aware and seemed to be overlooked.  Not to change subject, where I work at, a bug was found in a non-IIS feature that was overlooked and the developer was like "what the heck, we missed that".  This is probably the same case.  Who knows.  Hope MS gets the point and will respond. 

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: My Windows 2003 rocks!

    Dec 03, 2009 07:54 PM|merk|LINK

    ah ok - well i agree saying not to use it might be a bit over the top, depending on your individual situation.

    I would however say that i think it's a bit unfair to say someone didn't do the research if MS has known about this for a while and does not have a KB article or some other notice about it in the win2k8 r2 documentation.

    What i meant about paying is that people paid for MS - they didn't pay for the PDF files ( I assume). So if i do nothing other then upgrade the MS product i am using and something breaks, it seems only natural you expect more from the person you paid versus the company you didn't pay.

    I'm glad MS is trying to be more standards compliant, but you also have to be practical. If being standards compliant means no one can use it, there's not much point in following the standard IMHO.

    In any case, i REALLY hope someone at MS can at the very least put up a KB article on this. That would be a nice step in the right direction until they have a patch.
  • Re: My Windows 2003 rocks!

    Dec 04, 2009 09:43 AM|Peter Buelens|LINK

    And who said Lionel was putting this into production? We were evaluating 2008 R2 for this product. And we discovered the PDF problem. Luckily we can post messages here so that we can warn people about it and avoid them spending time rolling out a new platform into production. Not MS bashing, just open communication. If it breaks 90% of your client base why should someone even try to deploy it? As Microsoft is rolling out SP1 of their products sooner to fight the rule "not implement before SP1" I would even implement the rule "not implement before SP2".

    Am I to blame to say so? I consider this experience and common sense...

  • Re: PDF Handler - Server Wide

    Dec 04, 2009 01:49 PM|merk|LINK

    wshackne

     I just had one of my developers create a strongly named assembly.  We got it into the GAC without a hitch.  You can get it at http://www.mediafire.com/?2ngqgwzzmzn

    So, here is what I did to get it working:

    1. Copied IIS7PDFDownloadHandler.dll into the c:\windows\assembly folder
    2. In IIS Manager selected the Home screed root web server (NS2) and then clicked on Handler Mappings
    3. Clicked "Add managed handler."  
    4. In Request Path used "*.pdf"  Selected DLL in Type and for name put "IIS7PDFDownloadHander"
    5. Clicked "Request Restriction" and gave it execute access.

    That is it!  Tested and it works like a champ!

    Now...if only Microsoft would fix IIS 7.5.  Good luck with that one.

     

     

    S

    I just tried this on my machine - it doesn't work. Or rather, it works some times. I tried opening a 300k pdf file and it worked. Tried opening a 3000k (3meg) pdf file and it failed, other then in IE. Tried opening another pdf that is 1300k and that also failed to open. Tried to open a pdf that was 700k - also didn't work.

    Has anyone else gotten this to work for opening pdf's more then a few hundred kb?
  • Re: PDF Handler - Server Wide

    Dec 04, 2009 02:18 PM|Stussyredhat|LINK

    I have gotten this to work with the same results. I have noticed that in the event viewer I get these errors all the time. Is anyone else using this getting the same errors?

    - System

    <div>
    - Provider
    <div>
    [ Name] ASP.NET 2.0.50727.0
    </div>
    - EventID 1334
    <div>
    [ Qualifiers] 49152
    </div>
    Level 2
    Task 0
    Keywords 0x80000000000000
    - TimeCreated
    <div>
    [ SystemTime] 2009-12-04T19:07:07.000000000Z
    </div>
    EventRecordID 16416
    Channel Application
    Computer XXXXXX
    Security
    </div>

    - EventData

    <div>
    An error occurred during a process host idle check. Exception: System.AccessViolationException Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. StackTrace: at System.Collections.Hashtable.GetEnumerator() at System.Web.Hosting.ApplicationManager.IsIdle() at System.Web.Hosting.ProcessHost.IsIdle()
    </div>

     

    On another not we have been trying a few thing and on thing that seems to work so far is if you go to HTTP response headers in IIS manager and create a new header with a Name of "Accept-Ranges" and a value of "none" and do a iisreset it seems to work. The only thing is what will this break if we are ignoring all Ranges. Can someone else try this and let me know?

  • Re: PDF Handler - Server Wide

    Dec 04, 2009 02:35 PM|merk|LINK

    Ok this is strange. I took the dll i created and signed it so i could drop it in the GAC. Put it in the gac, when into IIS and created a handler mapping for it for the whole server. and it doesn't work very well.

    I then take the unsigned dll that i was using just on a single site - same code - just not signed. I disable the global handler i created, re-create the handler just for the specific website using the unsigned handler, and it works.

    I then delete the local mapping, delete the unsigned dll and replace it with the signed version. I re-create a mapping just for the individual website and it works.

    So any ideas why it seems to fail only when it's placed in the GAC and a global handler is created?
  • Re: PDF Handler - Server Wide

    Dec 04, 2009 03:34 PM|merk|LINK

    Also just came across another problem. I have a website which i updated and switched over to 4.0

    When i try to add a managed handler to this site, nothing shows up in the type drop down box. Same dll is in the bin folder that was in the net 2.0 version. I also tried re-compiling the dll using 4.0 and adding that into the bin folder - i still get nothing under the managed types drop down.

    Am i missing something really obvious?
  • Re: PDF Handler - Server Wide

    Dec 04, 2009 06:17 PM|ma_khan|LINK

    Loooong thread to read... I have been a bit lucky than others out here... I had a spare windows server 2003 box at my disposal... here's what I did...created the same directory structure on windows server 2003 box and moved all the pdf's out there (fortunately all my pdf's were in a single directory named pdffiles)...

    And placed this small little code in web.config in the website to use with URL re-write on the IIS 7.5 machine:       

    <rewrite>
                <rewriteMaps>
                    <rewriteMap name="pdf" />
                </rewriteMaps>
                <rules>
                    <rule name="PDF" stopProcessing="true">
                        <match url="^pdffiles/([_0-9a-z- ]+)([.]+)([pdf]+)" />
                        <action type="Redirect" url="http://iis6/{R:0}" />
                    </rule>
                </rules>
            </rewrite> 

    you can do the same if you have a spare IIS 6 or IIS 7 box...  2 points to remember;

    1.) This is a re-direct rule

    2.) Your content has to be on the re-directed box... doesnt make a diff if it's not on the IIS 7.5 box.

    I know this is pretty simple and a work around but why care unless it works... :)

    Hope this helps someone... Interesting discussion though guys... 

  • Re: PDF Handler - Server Wide

    Dec 05, 2009 04:19 AM|steve schofield|LINK

    Nice alternative.  Did you use URLRewrite 1 or 2?

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: PDF Handler - Server Wide

    Dec 05, 2009 08:01 AM|ma_khan|LINK

    URL Rewrite 1.1... Considering the circumstances here dint want to use any product that's not yet in a released state... :-) :))

     

     

  • Re: PDF Handler - Server Wide

    Dec 09, 2009 03:32 PM|Stussyredhat|LINK

    Well I think I have something that works, my developers did some research and have made a http module with the following code. I registered in the GAC and applied it server wide and it seems to be working, no errors like I was getting before in the event viewer from the handler.

    Below are contents of dll if anyone would like the dll please let me know.

    using System;
    using System.Web;
    namespace pdfHttpModule
    {
        public class pdfHttpModule : IHttpModule
        {
            public void Init(HttpApplication app)
            {
                app.PreSendRequestHeaders += PreSendRequestHeaders;
            }
            public void Dispose() { }
            protected void PreSendRequestHeaders(object sender, EventArgs e)
            {
                if (HttpContext.Current.Response.ContentType == "application/pdf")
                {
                    HttpContext.Current.Response.Headers.Add("Accept-Ranges", "none");
                }
            }
        }
    }
  • Re: PDF Handler - Server Wide

    Dec 09, 2009 04:05 PM|bdenglish|LINK

    How did you guys get around implementing the method ProcessRequest() and the property IsReUsable()?

     Thanks

  • Re: PDF Handler - Server Wide

    Dec 10, 2009 05:51 AM|namtab|LINK

    bdenglish

    How did you guys get around implementing the method ProcessRequest() and the property IsReUsable()?

     Thanks



    It's an HttpModule, not an HttpHandler....
  • Re: PDF Handler - Server Wide

    Dec 10, 2009 09:15 AM|bdenglish|LINK

    Sorry about that.  So does this require any sort of change in the web.config or anything?

  • Re: PDF Handler - Server Wide

    Dec 10, 2009 10:13 AM|Stussyredhat|LINK

    No there was no changes that needed to be made to the web config if you are applying at server level. If you are putting at site level then it needs to go under system.webserver under modules.

  • Re: PDF Handler - Server Wide

    Dec 10, 2009 10:22 AM|bdenglish|LINK

    Ok, so just to make sure that i am not missing anything.

    1) compiled your code as a signed assembly

    2) dropped signed assembly into the GAC

    3) ran IISReset

    Should that be all that needs to be done?  That was my process and i am still having issues with Firefox.

  • Re: PDF Handler - Server Wide

    Dec 10, 2009 10:40 AM|Stussyredhat|LINK

    One more step you need to go to iis manager at the root level and go to the modules and add a managed module the module will be in the drop down list and name the module and click Ok.

     

  • Re: PDF Handler - Server Wide

    Dec 10, 2009 01:53 PM|merk|LINK

    is an iisreset needed? I've tried adding this site-wide and it doesn't work for me. Only works when i do it on a site by site basis. but I'm not sure if i did an iisreset when i tried adding it site-wide.
  • Re: PDF Handler - Server Wide

    Dec 10, 2009 06:28 PM|merk|LINK

    well whatever my problem is, iisreset didn't correct it. tried implementing the handler server-wide again and still doesn't work unless i do it on a site by site basis.
  • Re: PDF Handler - Server Wide

    Dec 11, 2009 03:00 PM|Stussyredhat|LINK

    Just an update from Microsoft

     I just wanted to send you a quick update about the issue and keep in touch until the private is released.The DCR is still under development and things look good for now for a close release of the private for testing. I will keep you posted. Thank you for your patience and collaboration 

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Handler - Server Wide

    Dec 12, 2009 05:29 AM|Rovastar|LINK

    Thanks for the update. What a shame MS staff have lost the ability to post in this thread.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Handler - Server Wide

    Dec 15, 2009 02:27 PM|bdenglish|LINK

    We are ok with going the site by site route.  I have implemented the change on all of our asp.net sites, and it works great.  Seems to be no problem on those.  One problem we are having, we have a few classic asp sites we host and the same method does not appear to work for those.  Basically our asp.net sites are running dotnet nuke so the following are the steps i performed to get those working:

    copied the unsigned dll into the bin for each dnn installation,

    added the element to the web.config in the <system.web><httpmodules> section.

    Since my classic asp site did not have a a bin directory, i copied the assembly into the C:\Windows\System32\inetsrv folder.  Added the system.web httpmodules section to the web.config, and i still get the problem on the asp sites.  Any ideas what i am doing wrong?

  • Re: PDF Handler - Server Wide

    Dec 15, 2009 03:03 PM|merk|LINK

    Is there some reason you can't just create a BIN folder in your classic asp sites and drop the file in there?
  • Re: PDF Handler - Server Wide

    Dec 15, 2009 03:24 PM|Stussyredhat|LINK

    bdenglish

    We are ok with going the site by site route.  I have implemented the change on all of our asp.net sites, and it works great.  Seems to be no problem on those.  One problem we are having, we have a few classic asp sites we host and the same method does not appear to work for those.  Basically our asp.net sites are running dotnet nuke so the following are the steps i performed to get those working:

    copied the unsigned dll into the bin for each dnn installation,

    added the element to the web.config in the <system.web><httpmodules> section.

    Since my classic asp site did not have a a bin directory, i copied the assembly into the C:\Windows\System32\inetsrv folder.  Added the system.web httpmodules section to the web.config, and i still get the problem on the asp sites.  Any ideas what i am doing wrong?

    So to understrand what you did on your .net websites you just put the dll in the bin folder and then added the line to your web config correct?

    For your classic ASP sites what idenity are the app pools configured to run under?

  • Re: PDF Handler - Server Wide

    Dec 15, 2009 03:24 PM|bdenglish|LINK

    Well, that was worth a try.  Still same result in Firefox. 

    I created the bin folder under the website root, copied the unsigned dll into the folder, and even ran IISRESET.  Still when I try to access the pdf on our site, it stops!

  • Re: PDF Handler - Server Wide

    Dec 15, 2009 03:36 PM|bdenglish|LINK

     That is correct as far as the .net sites.  I copied the unsigned dll into the bin folder for each site added the one section into my web.config for each site, and it is working great.

    As for your second, question, it appears the Identity is running under is NetworkService.  

  • Re: PDF Handler - Server Wide

    Dec 15, 2009 03:49 PM|Stussyredhat|LINK

    I would try to register the dll in the GAC and make sure network service has read permissions to folder and create web.config with the entry like below but make sure you add name matches what you put in GAC

    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <modules>
                <add name="pdfHttpModule" type="pdfHttpModule.pdfHttpModule, pdfHttpModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=613d543517c4166b" />
            </modules>
        </system.webServer>
    </configuration>

  • Re: PDF Handler - Server Wide

    Dec 16, 2009 10:43 AM|bdenglish|LINK

    Ok, I have tried that methodology  a few times.  Basically what I have going on is a virtual directory under the asp website that houses an asp.net application.  For some reason, when i put the <modules> section in the web.config file for the asp page, it keeps throwing an error on the site that lives in the virtual directory below the asp site.  It appeared to be sharing the app pool, i moved the asp.net site to its own app pool still same problem.

  • Re: PDF Download Problems with IIS7

    Dec 18, 2009 04:02 PM|Mastic|LINK

    We have just recently migrated our site to a Windows 2008 R2 / IIS 7.5 Sever, and we have experienced the same problem. PDF files do not open on Firefox with the Adobe Reader 9.2 plug-in (the browser freezes and crashes). PDF files seem to open just fine on IE8, and on Firefox if an older version of the Adobe Reader plug-in is installed. Our web host tried downgrading IIS to version 6, but that did not solve the issue. As a temporary fix, we installed WAMP (an Apache server for Windows) on our Windows 2008 Sever to serve the PDF files on port 88 (While IIS7.5 serves the rest of our website on port 80). This is not an elegant solution, but it seems to work well as a temporary fix until Microsoft and Adobe come up with a solution.The idea behind this "fix" is that Apache handles it's own range-specific requests in a different manner than IIS7.5.

  • Re: PDF Download Problems with IIS7

    Dec 18, 2009 05:50 PM|Stussyredhat|LINK

    Got another update from Microsoft read below.

    I just wanted to give you  a status update on this issue.The hotfix is still under development but the good news is that we are close to releasing  a private for you to test around the end of this month. I also wanted to let you know that I will be out of the office vacation next week. For any urgent issues, please contact the duty manager with the below information.

     

  • Re: PDF Download Problems with IIS7

    Dec 18, 2009 05:59 PM|merk|LINK

    Hey Stussy - can you find out who we have to contact to also get access to the hotfix?

    thanks for keeping us updated.
  • Re: PDF Download Problems with IIS7

    Dec 21, 2009 02:11 PM|Stussyredhat|LINK

    I will do what I can.

  • Re: PDF Download Problems with IIS7

    Jan 08, 2010 04:15 PM|sk123|LINK

     Just wondering if MS ever did an official patch for this?

  • Re: PDF Download Problems with IIS7

    Jan 08, 2010 04:31 PM|Stussyredhat|LINK

    I have just recived test fix from Microsoft will let you guys know how it goes.

  • Re: PDF Download Problems with IIS7

    Jan 08, 2010 04:53 PM|bdenglish1|LINK

     We would love to be on the beta test list for this fix.  What steps do we need to go through to get on this list?

  • Re: PDF Download Problems with IIS7

    Jan 08, 2010 06:13 PM|Lionel Schiepers2|LINK

    This fourm is moderated now.

    Microsoft doesn't assume this problem?

     

  • Re: PDF Download Problems with IIS7

    Jan 08, 2010 06:15 PM|Lionel Schiepers2|LINK

     There is a great new functionality in Windows 7, the calculator lets you calculate an interval between two dates.

    Windows 2008 R2 is available since 14 august 2009 (on MSDN). It means that since 147 days!, Microsoft did not:

    -  Put any feedback concerning this problem

    - No knowlegde base

    - no QFE

    - no Hotfix

    - no Service pack


  • Re: PDF Download Problems with IIS7

    Jan 08, 2010 06:16 PM|Lionel Schiepers2|LINK


    If W2K8R2 is really minwin, I don't understand what is better with a componentized OS with few dependencies.

     

    If IIS 7.5 was published on codeplex, this bug would have been corrected since months! If it had happened with Apache Web Server, patches would have been available few days after the release.

     

    Regards.

  • PDF Download Problems with IIS7.5

    Jan 11, 2010 10:04 AM|lionel schiepers|LINK

     In reply to "Your post was deleted by tomkmvp.

    ....

    All replies to a thread must contribute value to the discussion. Perhaps you can revisit the forums and submit a more helpful post.
    "
     

    Hello Tom,

    The following mail has this footer : “All replies to a thread must contribute value to the discussion”
     

    I think that advising to the people involved in this thread to keep running a proved but older OS that just works instead of using W2K8R2 with show stopper bugs like this one adds a value to the discussion. This advise is certainly far better than the advises written by MVP that says “Microsoft will publish a fix very soon and Microsoft is the coolest company of the world. We all know that it's a_p_p_l_e” in the beginning of October but nothing yet.

    My remarks concerning the release schedule of Microsoft contributes to confirm my first affirmation.

    It’s a pity that Microsoft has more time to remove this thread instead of writing a knowledge base about this bug and let other users know that IIS 7.5 is not ready for production use (especially if you have pdf files) but it’s better to rely on IIS 7.0 or II 6.0.

    Hopping that this anti democratic forum policy helps Microsoft to earn more money.

    Regards,

    Lionel Schiepers.

  • Re: PDF Download Problems with IIS7.5

    Jan 11, 2010 03:17 PM|Dervish_Moose|LINK

     So anymore word on if the hotfix beta that has been referenced in past posts works? Any ETA on the hotfix? Are we looking at days, weeks or months? Basically I need to decide if I need to spend the time / $, (yes it is a fair amount of time/$) on fixing this issue (by moving the PDFs to a non WS08 R2 server) or if I can just wait a few days till the issue is fixed by MS. 

  • Re: PDF Download Problems with IIS7.5

    Jan 11, 2010 05:53 PM|Stussyredhat|LINK

    My testing so far is good I have one more test on live server I will let you know in morning.

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7.5

    Jan 13, 2010 11:16 AM|Rovastar|LINK

    Dervish_Moose

     So anymore word on if the hotfix beta that has been referenced in past posts works? Any ETA on the hotfix? Are we looking at days, weeks or months? Basically I need to decide if I need to spend the time / $, (yes it is a fair amount of time/$) on fixing this issue (by moving the PDFs to a non WS08 R2 server) or if I can just wait a few days till the issue is fixed by MS. 

     

    I cannot imagine it is a just few days for the official MS fix.

    However if you raise a support call with MS, I imagine, will be able to test drive the beta hotfix (you might have to request this) that appears ok.

     

     

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7.5

    Jan 13, 2010 11:36 AM|lionel schiepers|LINK

    Adobe reader 9.3 is out.

     

    Perhaps someone could try it to see if it solves the problem because I have no more W2K8R2 installed due to this bug.

    http://fileforum.betanews.com/detail/Adobe-Reader-for-Windows-2000XPVista2008/942951453/1

     

    Regards,

    Lionel Schiepers.

  • Re: PDF Download Problems with IIS7.5

    Jan 18, 2010 11:07 AM|sk123|LINK

    Stussyredhat, did the hotfix work for you?

  • Re: PDF Download Problems with IIS7.5

    Jan 18, 2010 11:56 AM|Stussyredhat|LINK

    My testing has went with no errors eveything is working as it should now. I have gave my results to Microsoft. They said that they will need to finish internal testing and the hotfix should be released soon.

  • Re: PDF Download Problems with IIS7.5

    Jan 20, 2010 10:21 AM|t.a.King|LINK

    I, too, tested the hotfix with no issues.  I asked the support contact at Microsoft how long it will take for this fix to be available for production installation.  He stated "at most" 60 days.  Perhaps it will be available sooner than that, but it seems businesses should plan with the idea that the fix will not be available until around the end of March 2010.

  • Re: PDF Download Problems with IIS7.5

    Jan 20, 2010 11:26 AM|sk123|LINK

    How does one go about getting the current hotfix from MS?
  • Use adobe reader 9.3 if you are blocked

    Jan 20, 2010 01:20 PM|Lionel Schiepers2|LINK

    If someone is blocked with this issue, you can use the latest version of adobe reader 9.3. I tried it and successfully downloaded a PDF file of 280MB.

    6 months to develop this little hot fix... I bet that the time to develop the new byte-range implementation of IIS 7.5 tooked less time than the fix!

    I'm still thinking that it's far safer to avoid using W2K8R2 in product until the first service pack is out (perhaps the SP will be out before the fix too ? o-). This is a evidence since the priority of a fix depends on the number of support incidents. 6 months means that very few people are using W2K8R2 as a web server....

     

    Good luck,

    Lionel.


  • Re: Use adobe reader 9.3 if you are blocked

    Jan 20, 2010 01:22 PM|lionel schiepers|LINK

    Lionel Schiepers2

    If someone is blocked with this issue, you can use the latest version of adobe reader 9.3. I tried it and successfully downloaded a PDF file of 280MB.

    6 months to develop this little hot fix... I bet that the time to develop the new byte-range implementation of IIS 7.5 tooked less time than the fix!

    I'm still thinking that it's far safer to avoid using W2K8R2 in product until the first service pack is out (perhaps the SP will be out before the fix too ? o-). This is a evidence since the priority of a fix depends on the number of support incidents. 6 months means that very few people are using W2K8R2 as a web server....

     

    Good luck,

    Lionel.


     

     

    Thanks! ;-)

  • Re: Use adobe reader 9.3 if you are blocked

    Jan 25, 2010 01:50 PM|t.a.King|LINK

    I just installed the Adobe Acrobat update on my client, ensured that FireFox is using the 9.3.0.148 version of the Acrobat plugin (was using 9.1.0.163 before update), navigated the browswer to a PDF on my 2008 r2 Web Server, and no joy.  Same results - PDF does not download, just stops.

     Anybody else have any luck with this Acrobat upgrade and PDFs over IIS 7.5 using Firefox?

    I did successfully download the same PDF a couple times using I.E. 8, but my experience over the last couple of months is that these would work over I.E. some of the time, but not consistently, so I'm not sure the upgrade has helped in I.E.

  • Re: PDF Download Problems with IIS7.5

    Jan 25, 2010 01:53 PM|t.a.King|LINK

    The hotfix has not be released to the public yet.  Per one Microsoft technician, it should be available by the end of March at the latest.

  • Re: PDF Download Problems with IIS7.5

    Feb 04, 2010 06:06 AM|Ceessie|LINK

    What we tried as a temporary fix is change the MIME-type in IIS to 'application/octet-stream'. That seems a workable solution until a fix is released.
  • Re: PDF Download Problems with IIS7.5

    Feb 04, 2010 03:54 PM|t.a.King|LINK

    Latest from Microsoft technician is that official hotfix will be released the end of February 2010.

  • Re: PDF Download Problems with IIS7.5

    Feb 10, 2010 02:15 PM|nlindley7|LINK

     

    Ceessie

    What we tried as a temporary fix is change the MIME-type in IIS to 'application/octet-stream'. That seems a workable solution until a fix is released.

     

    what did this solve for you?

  • Re: PDF Download Problems with IIS7.5

    Feb 28, 2010 08:46 PM|tryniski|LINK

    Has anyone got the hot fix from Microsoft for this problem ... I was under the impression that the fix would be out by the end of this month(FEB).......
  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 03:37 PM|t.a.King|LINK

    I just checked in with the Microsoft Tech who is handling the case, and he said "...the release got slipped one more week.  We are expecting the hotfix to be publically released end of this week."  So that would be around March 5.

  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 04:50 PM|lionel schiepers|LINK

    My experience says that its safer to keep in production a W2K3 or W2K8 server and waiting for the first service pack of W2K8R2.
  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 05:04 PM|lionel schiepers|LINK

    Could someone share a problem where W2K8R2 is mandatory and it's impossible to use W2K8 or W2K3 instead?


  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 05:22 PM|lionel schiepers|LINK

    A patch is being implemented since weeks but it's a shame that there is still no knowledge base on the support website of microsoft.

     


  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 05:26 PM|anthonymking|LINK

    Lionel,If you aren't using Windows Server 2008 R2, perhaps you could unsubscribe from this thread rather than coming here with insults and name calling?
  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 06:19 PM|lionel schiepers|LINK

    Don't blame me if I think that after 10 months, it's a shame that there is not even a KB.

     

  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 06:26 PM|lionel schiepers|LINK


  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 06:27 PM|merk|LINK

    Lionel, i agree with anthonmking - you are just being rude. Why do you need to call everyone stupid? Especially since you dont even know how to unsubscribe from the thread. Instead of calling you stupid for not knowing how to do that, i'll just tell you you can scroll up to the top of the page and click on the button to turn off email notifications. The rest of us are here to get a solution to a problem. We aren't here to insult people. Don't you have anything better to do with your time?
  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 06:55 PM|lionel schiepers|LINK

    Many threads from Microsoft or MVP say in this thread: pay 300€ for a support incident because the priority of a support incident depdends on the number of peoples reclaiming it. Do you think it's normal and do you think those people will be charged back since we all know IIS 7.5 is RFC compliant?

    Why Microsoft did published the workstation and server version of windows 7 at the same time? If they had done like the previous OSs, MS would have remarked this incompatibility concerning IIS 7.5 before releasing the server version.

     

     

  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 07:08 PM|lionel schiepers|LINK


  • Re: PDF Download Problems with IIS7.5

    Mar 02, 2010 07:12 PM|lionel schiepers|LINK

    I hope you will have a resolution as soon as possibe. I didn't try it but the mime-type seems to be the best fix actually.

     

    Regards.

     

     

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7.5

    Mar 03, 2010 06:35 AM|Rovastar|LINK

    Lionel,

    I don't think your previous comments were constructive at all. Attacking the MS staff and the MVPs is not needed and is rude. I am glad you had the foresight to edit your posts.

    The sitution is a complex one and I too am disappointed at some aspects of this. More information should have been shared and a prompter solution provided and the way of organising the prioities of this problem seem poor based on support calls only (I was never going to raise a call and realised that their is a problem). 

    However there is light at the end of the tunnel and the patch is out shortly. Personally I also think that there should be some elements of testing of the new systems from the web admin and not soley in MS's court.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7.5

    Mar 08, 2010 03:37 PM|lionel schiepers|LINK

    Rovastar

    Lionel,

    I don't think your previous comments were constructive at all. Attacking the MS staff and the MVPs is not needed and is rude. I am glad you had the foresight to edit your posts.

    The sitution is a complex one and I too am disappointed at some aspects of this. More information should have been shared and a prompter solution provided and the way of organising the prioities of this problem seem poor based on support calls only (I was never going to raise a call and realised that their is a problem). 

    However there is light at the end of the tunnel and the patch is out shortly. Personally I also think that there should be some elements of testing of the new systems from the web admin and not soley in MS's court.

     

     

    I agree with your remark concerning the fact that the web admin should first try a new OS. That's why I don't use it in production because I first try it (and I'm not a web admin, I'm a software architect). But I disagree about the complex situation. If the patch was some difficult to develop, we should have at least received a QFE that disable the byte-range feature when the user agent is adobe reader because this problem is too important. It should have temporarily solved the problem until a better solution is found.

     

    A previous post says that the patch should have been available for March 5, does it?

     

    Regards.

     

     

     

     

  • PDF Download Problems with IIS7.5

    Mar 10, 2010 02:43 PM|lionel schiepers|LINK

    Do we have an idea of the new release date of patch and when an information will be available on support.microsoft.com ?

    I've just seen that http://iis.net that is said the Official Microsoft IIS Site don't even run IIS 7.5 (the http response header says Microsoft-IIS/7.0).

     

    Thanks to the beta tester consumer, Microsoft knows it could not publish a file like this one: htt://www.iis.net/downloads/files/media/smoothspecs/Protected%20Interoperable%20File%20Format%20%28PIFF%29.pdf if he upgrades the server.... :-(

  • Re: PDF Download Problems with IIS7.5

    Mar 12, 2010 02:33 PM|t.a.King|LINK

    I'm told by the Microsoft technician working my case that anyone can get this hotfix by calling Microsoft Support and referencing KB979543.  He said there would be no cost. 

    This KB article is not up on the Microsoft web site yet, but he said he thought it would be up next week.

    I've installed the hotfix and everything seems to be working.

  • Re: PDF Download Problems with IIS7

    Mar 17, 2010 11:17 AM|mjda|LINK

    I've built a custom HttpHandler to serve PDF. It's ugly but it works...

    Imports System.IO
    Imports System.Web
    ' http://msdn.microsoft.com/en-US/library/ms228090(VS.80).aspx
    ' http://www.15seconds.com/Issue/020417.htm
    ' Let's compile it and place it in the bin directory of the webapp virtual directory.
    ' Step 2
    ' Register this handler by adding the following text in the web.config file:
    ' <httpHandlers>
    ' <add verb="*" path="*.pdf" type="LibwarePDFhandler.NewHandler,LibwarePDFhandler"/>
    ' </httpHandlers>
    Namespace LibwarePDFhandler
    Public Class NewHandler
    Implements IHttpHandler
    Public ReadOnly Property IsReusable() As Boolean Implements System.Web.IHttpHandler.IsReusable
    Get
    Return True
    End Get
    End Property
    Public Sub ProcessRequest(ByVal context As System.Web.HttpContext) Implements System.Web.IHttpHandler.ProcessRequest
    Try
    context.Response.Clear()
    context.Response.ClearHeaders()
    context.Response.ContentType =
    "application/pdf"
    'context.Response.Cache.SetCacheability(HttpCacheability.Private)
    If (File.Exists(context.Request.PhysicalPath)) Then
    'context.Response.OutputStream
    'Dim byteCount As Long = My.Computer.FileSystem.GetFileInfo(context.Request.PhysicalPath).Length
    context.Response.BinaryWrite(File.ReadAllBytes(context.Request.PhysicalPath))
    Else
    Throw New Exception("File not found: " & context.Request.Path)
    End If
    context.Response.End()
    Catch ex As Exception
    My.Application.Log.WriteException(ex)
    End Try
    End Sub
    End Class
    End
    Namespace

    iis 7 r2

  • Re: PDF Download Problems with IIS7

    Mar 17, 2010 11:20 AM|mjda|LINK

    <div class=ForumPostContentText>


     

    </div>

    iis 7 r2

  • Re: PDF Download Problems with IIS7.5

    Mar 17, 2010 11:28 AM|lionel schiepers|LINK

    Hi,

     Thanks for your handler,

    I think that context.Response.WriteFile would be better because it won't load the whole file in memory.

     

    Lionel.

     

     

  • Re: PDF Download Problems with IIS7.5

    Mar 21, 2010 06:16 PM|lionel schiepers|LINK

    http://support.microsoft.com/kb/979543

     

  • Re: PDF Download Problems with IIS7.5

    Mar 30, 2010 05:34 AM|Alesh_77|LINK

    Did anyone test this fix? Does it work?

    Please post your findings..

    Thanks, Alesh

  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7.5

    Apr 06, 2010 05:37 PM|Rovastar|LINK

    Glad to see this has been released and the issue can now be put to bed. I hope there is more feedback from the Microsoft in the future for issue like this. It doesn't fill me with much confidence at times........

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7.5

    Apr 06, 2010 11:14 PM|steve schofield|LINK

    Ditto.  And we won't have people ranting anymore....grin..

    Steve Schofield
    Windows Server MVP - IIS
    http://iislogs.com/steveschofield
    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget

  • Re: PDF Download Problems with IIS7

    Apr 21, 2010 04:20 PM|codarin|LINK

     Dear Redhat...

    I noticed you had in the past this error

    "[ Name] ASP.NET 2.0.50727.0 - EventID 1334 [ Qualifiers] 49152 Level 2 Task 0 Keywords 0x80000000000000 - TimeCreated [ SystemTime] 2009-12-01T20:10:27.000000000Z EventRecordID 12898 Channel Application Computer XXXXXXX Security - EventData An error occurred during a process host idle check. Exception: System.AccessViolationException Message: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. StackTrace: at System.Collections.Hashtable.GetEnumerator() at System.Web.Hosting.ApplicationManager.IsIdle() at System.Web.Hosting.ProcessHost.IsIdle()"

     

    Have you found a solution?

    I'm not working with DLLs for PDF... but I have the same error message repeated many times a day... and on my Server2008R2(X64) worker processes and IIS 7.5 are very unstable.

     

    Many thanks

  • Re: PDF Download Problems with IIS7

    Apr 21, 2010 05:01 PM|Stussyredhat|LINK

    When talking with the microsoft rep he suggested to set the Load User Profile to False and that has taken care of the issue.

  • Re: PDF Download Problems with IIS7

    Apr 22, 2010 03:32 AM|codarin|LINK

    Many thanks, we have different application pools in "Classic Mode" with ASP.NET 2 + 3.5 pages. This on Windows Server 2008 R2 x64 (iis 7.5) with 32bit compatibility turned on. We have a NLB with two identical nodes on Vwmare Esx 3.5 In the Process Model of our ApplicationPools we set: identity: ApplicationPoolIdentity IdleTimeout: 60mins LoadUserProfile: *false* Do you have the "same identity" for your app-pools? Many thanks
  • Re: PDF Download Problems with IIS7

    Jun 01, 2010 11:57 PM|bchavez|LINK

    woow... I'm running into the same problem... Thanks for everyone's effort in getting MS to provide backwards compatibility.
  • Re: PDF Download Problems with IIS7

    Jun 04, 2010 02:26 PM|Erick T|LINK

    Did this workaround work correctly? I am running into the same issue.

    Thanks,
    Erick

  • Re: PDF Download Problems with IIS7

    Jun 04, 2010 02:46 PM|merk|LINK

    the hotfix solved it for me on two servers with no apparent ill side-effects.
  • Re: PDF Download Problems with IIS7

    Jun 04, 2010 04:13 PM|Erick T|LINK

    Thanks! So far it's been working here as well... hopefully no ill effects will manifest.

  • Re: PDF Download Problems with IIS7

    Nov 23, 2010 11:39 AM|webhacker|LINK

    Sorry to bring up an old post, but I am running into this issue with Windows 2008 Server SP2 (not R2). Any of the PDF files served seem to come up with the standard adobe error about the file not able to be repaired. So far, all of my PDF files are in a single folder, and what I've done is make it an application and assign it to the Classic ASP.NET application Pool. This fixes it, but I have a feeling that it is just a band-aid because it's unrealistic to think all the PDF files will always be in a single folder. I've tried applying the hotfix and it won't allow me because I'm not running R2. Has anyone else had this problem with non-R2 versions, and what have you done to fix it?
  • Rovastar Rovastar

    5495 Posts

    MVP

    Moderator

    Re: PDF Download Problems with IIS7

    Nov 27, 2010 10:28 AM|Rovastar|LINK

     This thread is to do with IIS7.5 not IIS7.0 you should start a new thread as the causes will be different.

    Troubleshoot IIS in style
    https://www.leansentry.com/
  • Re: PDF Download Problems with IIS7

    Dec 02, 2010 11:57 AM|webhacker|LINK

    I have just tried it on my development machine (Windows 7) and I'm running into the same issue. If I'm not mistaken, it is IIS 7.5 and I have also just run into a PDF that is served outside of the 'pdf' folder that is assigned the Classic ASP.NET application pool. It needs to stay in the special folder because of permissions so I can't even move it to 'pdf'. Any ideas?
  • Re: PDF Download Problems with IIS7

    Dec 02, 2010 04:30 PM|webhacker|LINK

    Just a quick update....... When I was going through everything, I took a look at the HttpModules that were installed... as it turns out, one of the modules was affecting the PDF output. It was a White space removal module. Once I corrected that module, everything worked perfect on both IIS 7.0 and 7.5 .
  • Re: PDF Download Problems with IIS7

    Dec 02, 2010 08:06 PM|Ducott|LINK

    I also have the same reported problem. So I downloaded the hotfix from MS and during its install it tells me the update does not apply to my machine. Ok, im confused. I am running Windoes Server 2008 R2 x64 and IIS 7.5. It wont let me install it ?!?!?!?

  • Re: PDF Download Problems with IIS7.5

    Jun 24, 2011 02:15 PM|Campbell_DavidJ|LINK

    Tried this for our classic ASP site on Win2008r2/IIS7.5 and we still can't load PDFs.

    Any other tweaks needed? 

    lionel schiepers

    http://support.microsoft.com/kb/979543

     

  • Re: PDF Download Problems with IIS7.5

    Jun 24, 2011 02:15 PM|Campbell_DavidJ|LINK

    Tried this for our classic ASP site on Win2008r2/IIS7.5 and we still can't load PDFs.

    Any other tweaks needed? 

    lionel schiepers

    http://support.microsoft.com/kb/979543

     

  • Re: PDF Download Problems with IIS7.5

    Jun 29, 2011 01:13 PM|kettch|LINK

    I'm having this problem too, and apparently my machine is patched up far enough that the hotfix no longer applies. However, I've noticed that it only happens on PDF's that have been compressed by Acrobat. The full uncompressed versions still work. Could this still be a variation on the original problem?

  • Re: PDF Download Problems with IIS7.5

    Dec 02, 2011 05:22 AM|eax|LINK

    Does anyone have a solution to this problem?

    I had this problem on my IIS7.5 early in 2011 and i was able to fix it by installing the hotfix.

    In late september I installed Service pack and the problem reappeared. I am no longer able to install the hotfix.

  • Re: PDF Download Problems with IIS7.5

    Dec 21, 2011 06:26 AM|m_chieppa|LINK

    Try reverting IE9 back to IE8 on the server.
    This solved the problem for me.
    Regards
    Mauro
  • Re: PDF Download Problems with IIS7.5

    Feb 06, 2012 06:55 PM|brenwyn|LINK

    I have the same issue.  strange thing is that over HTTPS, everything is fine. 
  • Re: PDF Download Problems with IIS7.5

    Jan 09, 2013 06:20 PM|brent_oly|LINK

     


    Ultimately, this was solved by changing from E1000 to VMXNET3 NIC in Guest which was running on VMWare ESXI 5.0....