in reply to Showing Word document in browser
It looks like you are trying to build a multipart MIME entity containing the document (because of your use of boundaries) but you haven't got the right type on it. But:
Also, you get $bufsize to 60*57 (any special reason to pick this number 3420?) and you loop as long as it is still equal to 3420, which it always is since you never change it. It will loop forever.
What you need to do is far simpler:
if (open (INHOUD, "$regel")) { binmode INHOUD; print << "EOT1"; Content-Type: application/msword; filename="bw051122.doc" EOT1 while (read(INHOUD, $buffer, 4096) { print $buffer; }; close (INHOUD);
As a bonus, if you always send the same document, you could add Last-Modified and Expires headers to enable the client to cache the result just like if you have been able to do if the web server had served the file directly.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Showing Word document in browser
by Ernst (Initiate) on Jan 12, 2006 at 12:57 UTC | |
by blazar (Canon) on Jan 12, 2006 at 13:08 UTC | |
by Ernst (Initiate) on Jan 12, 2006 at 13:58 UTC | |
by blazar (Canon) on Jan 12, 2006 at 14:28 UTC | |
by Ernst (Initiate) on Jan 12, 2006 at 15:03 UTC | |
|