Peculiar WebRequest behaviour when specifying range with AddRange

R

Richard K Bethell

I tried this question in the C# group, but nobody followed up, so I hope I
might be able to ask again.

I have built a downloading engine that is designed to use the HttpWebRequest
and HttpWebResponse classes to draw files in 64K chunks, rather than pull a
file all at once. This is to ensure that the client is never overtaxed with
huge byte arrays or streams going into memory as the downloaded file is
written out to the file system.

It generally works really well - for image file types, PDF file types, and
raw data formats, I'm ecstatic about how well it works. However there's one
peculiar behaviour, and perhaps somebody has some insight.

For the Microsoft Office formats, the files do not arrive properly - they
are corrupt and unopenable. I've windiffed them against the originals and it
looks like there are huge gaping holes in the files - as though the data
offered by the web server has been truncated. I'm assuming this has
something to do with how IIS handles the mime types for PowerPoint and Excel
(the two formats where I noticed the troubles.)

has anyone got any insight on what might cause this, and how I can draw
these files by ranges?

Thanks,

R.
 
J

Joerg Jooss

Thus wrote Richard,
I tried this question in the C# group, but nobody followed up, so I
hope I might be able to ask again.

I have built a downloading engine that is designed to use the
HttpWebRequest and HttpWebResponse classes to draw files in 64K
chunks, rather than pull a file all at once. This is to ensure that
the client is never overtaxed with huge byte arrays or streams going
into memory as the downloaded file is written out to the file system.

It generally works really well - for image file types, PDF file types,
and raw data formats, I'm ecstatic about how well it works. However
there's one peculiar behaviour, and perhaps somebody has some insight.

For the Microsoft Office formats, the files do not arrive properly -
they are corrupt and unopenable. I've windiffed them against the
originals and it looks like there are huge gaping holes in the files -
as though the data offered by the web server has been truncated. I'm
assuming this has something to do with how IIS handles the mime types
for PowerPoint and Excel (the two formats where I noticed the
troubles.)

has anyone got any insight on what might cause this, and how I can
draw these files by ranges?

Can you post your code?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top