in reply to CGI outputs plain text -- can't "Save Page As?"
At first I thought it had something to do with the system function so I try to reproduce it with a simple script (system.cgi):
but it ran well on FireFox, it displayed the text on the browser, I could save it to a file, and the content is:#!/usr/bin/perl print "Content-type: text/plain\n\n"; system 'uptime';
However, I'm a bit curious to see the appearantly overlapping code below the while {} block in convert_word2.cg. You may try to remove that code that reopen the $out file and let fiction_word_to_txt prints its output directly to the browser so you don't have to redirect it to a temporary file, like:$ cat /tmp/uptime-system.cgi 09:08:55 up 1:10, 4 users, load average: 1.23, 0.80, 0.48
Another possible option is to convert the doc file on the fly without external program so it works with filehandle. In other words, streaming the file. Is fiction_word_to_txt a Perl program? See also if OLE::Storage can help you.system("/home/bcrowell/Documents/programming/scripts/fiction_word_to_t +xt <$in") and die "error executing fiction_word_to_txt: $!\n";
Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CGI outputs plain text -- can't "Save Page As?"
by bcrowell2 (Friar) on May 28, 2007 at 15:37 UTC | |
by naikonta (Curate) on May 29, 2007 at 09:11 UTC | |
by Joost (Canon) on Jun 01, 2007 at 22:25 UTC |