|Keep It Simple, Stupid|
Downloading images to client PCsby MrCromeDome (Deacon)
|on Sep 12, 2002 at 14:42 UTC||Need Help??|
MrCromeDome has asked for the wisdom of the Perl Monks concerning the following question:
I post this at the risk of sounding repetitive, but I am truly baffled at this problem. I posted the original problem in this node, and have come a little ways since then, but not much. I admit I am somewhat out of my league here - I'm not terribly familiar with how HTTP headers work, which could explain most of the problem I'm having.
To recap, I have a web site which allows clients to purchase copies of selected document images online. Once the transaction has been completed, I need to send the purchased document to the client browser. Images are in multipage TIFF format with group 4 compression. I have the image being delivered to the client browser, but what the client sees when they get the image is not at all correct.
Not at all correct, I realize, is rather vague. Results vary slightly from one browser/OS to another. On Win2k with IE 5.5, the default TIFF viewer for Windows reports that the document is not of a supported format. Using WinXP with IE 6, the default image viewer will recognize the proper number of pages in the image, but only the top 1/3 or so of the first page is actually readable (the rest of the image is black). If I save (and not view) the image with either Win2k or WinXP and then use a 3rd party image viewer to bring up the image, the results are similar to viewing the image with XP's default viewer.
I'm left to believe that either there is something wrong with my content header, or something is happening to the image during delivery to the browser. To be honest though, I think it's something I'm doing ;) Here's what I got thus far:
I'm confident that the image reading portion of that is ok. When the debugging info gets sent to the browser, what Perl reports the size on disk to be (and the size of $buffer) match what the file size on disk actually is. Once I was sure that I was reading it ok, I worked on delivering the image. I have tried the following things listed below. Check the comment above each for the result.
Is there something obvious (or not so obvious) that I'm missing here? I spent the better part of yesterday combing through the Monastery looking for additional insight, but I can't find something different than what I've tried (or else I'm misapplying something that I've found there).
Any help, comments, or insight are very much appreciated. Thank you!