Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8078949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T15:57:15+00:00 2026-06-05T15:57:15+00:00

I’ve have a web site I’m building using NodeJS, that needs to serve up

  • 0

I’ve have a web site I’m building using NodeJS, that needs to serve up some PDFs (among other files).

For reasons I cannot determine, Internet Explorer 8 will fail to completely download the PDF in the Acrobat Viewer first time round (and sometimes multiple times after). Saving the file directly works just fine, but this isn’t ideal. Chrome works fine, although I haven’t tested other browsers.

There is no error message, other than the status bar stops being updated and shows:
Downloaded (2.97 MB of 16.33 MB):
(source: twimg.com)

I’m serving the file via NodeJS and the Express (v3, beta2) / Connect framework (it’s the Connect Static middleware that is serving the file.) I’m also serving it via SSL, but turning this off doesn’t appear to help.

Any ideas would be greatly appreciated!
Thanks

EDIT – to include more details:

Firstly – I’ve upgraded from Express v2 to v3 to attempt to fix the issue – no such luck.

This is the app route that serves the files. The static serving component does work, so the issue appears to be somewhere within how either IE retrieves files or how express serves them to IE.

app.get('/store/*', ensureAuthenticated, express.static(__dirname + '/../uploads'));

function ensureAuthenticated(req, res, next) {
    if (req.isAuthenticated()) {    
        return next();
    }
} else {
    res.redirect('/login');
}

As far as errors – I see no 404 error or anything in IE. It simply hangs with a blank screen and the above image showing the amount downloaded in the bottom left status bar. Adobe eventually (~5 minutes later) fails with an alert of: "This file is damaged and cannot be repaired". I know the file is not damaged, because occasionally IE will load it (see Fiddler requests below).

In Fiddler, I see the following.
Multiple requests from IE for the PDF. 2 fail, 1 succeeds

The first two requests failed, while the third successfully delivered the PDF.

If there is anything else I can provide do let me know.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T15:57:17+00:00Added an answer on June 5, 2026 at 3:57 pm

    So, I figured out the problem (or at least, a solution or 4).

    It took me a while and an extensive amount of research, test cases and all sorts, but I got there eventually.

    When IE8 (and possibly other browsers too, but I’ve not extensively tested) uses the Adobe 9 (not verified with Adobe X or any other version) plugin to request a PDF, occasionally it’ll fetch the whole file as one. This is the success that I was seeing and corresponds to request 22 in the Fiddler screenshot above. It seems to grab the whole file if the file is small, but in this case I was testing with a 16MB PDF.

    In other cases, Adobe will send a range header of this form:

    Range: bytes=a-b, c-d
    

    Where a-b is a range and c-d is a range, which it appears is not continuous.

    My knowledge of Range headers isn’t that extensive, so I’m not sure if this is valid or not. The research I’ve done suggests not.

    Anyway, in Connect’s static.js it uses a range parsing method in lib/util.js called parseRange. This method returns an array of ranges in the following form:

    [
       { start: a, end: b },
       { start: c, end: d}
    ]
    

    In static.js it calls this method and assigns the values to ranges, then it uses ranges[0] to calculate the range, thereby ignoring the values c and d. The range between a and b is the only data read from the file and sent to the request.

    I believe Adobe 9 then continues waiting for more data, which causes the hanging I was seeing.

    The solutions

    • The simplest solution is to remove the header ‘Accept-Ranges’ in static.js
    • A more complex (and not necessarily correct) solution I’ve implemented is to take the minimum of a and c and the maximum of b and d to create a new range and to return that in the range checking code. This gist shows what I’ve done: https://gist.github.com/2930131
    • A third (possible) solution I believe would be to monitor when the client keeps waiting for data and do something with the connection (close it, send more data – I’m not sure!). I’ve no idea really how this would work though but I’ll try referring it to people who might.

    The second solution works for me in my use case. I hope if you’ve stumbled across it it’s useful for you too!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a French site that I want to parse, but am running into
I have thousands of HTML files to process using Groovy/Java and I need to
I have just tried to save a simple *.rtf file with some websites and
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a bunch of posts stored in text files formatted in yaml/textile (from
I have some data like this: 1 2 3 4 5 9 2 6
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.