[ale] OT: content-disposition and client-side perl
Joseph A Knapka
jknapka at earthlink.net
Thu Jun 13 12:02:08 EDT 2002
jenn at colormaria.com wrote:
>
> I'm trying to do the following, and I don't even know where to start
> looking forassistance:
>
> 0 - User registers application in browser to handle .cex (custom extension,
> as an example only) with a client side perl script I've written.
> 1 - User hits web application, which generates text for them to d/l.
> 2 - Web app sends these headers:
> content-type = application/cex;
> content-disposition = inline; filename=myfile.cex;
> content-length = 1024;
>
> 3) perl script on client side reads in data and does its thing (using
> perl/TK,this is a windows app, blech).
>
> So I've got 0-2 working great. And if I *download* the file, I can run
> the perlscript just fine. The missing piece is, how on earth can I make perl read
> thedata being pushed by the browser as if it were STDIN ??
>
> If anyone has any resources for something like this, search phrases to hit
> google/devshed with, anything at all I would be eternally grateful. In
> theoryit should be doable but I am boggled as to how.
The browser ought to have some way of specifying how to
invoke helper applications. On Netscape 4, for example,
you can go to Edit->Preferences->Navigator->Applications,
add a new .cex extension, choose "Application", and enter
"perl.exe myPerlScript.pl %s". Netscape will then execute
"perl.exe myPerlScript.pl tmpfile" when invoking the
user clicks on .cex links, where "tmpfile" is the name
of a temporary file to which the .cex file is downloaded.
It ain't stdin, but it's better than nothing.
I have not been able to find any documentation about
all the possible %x sequences that can appear in
Netscape's helper application configuration; maybe
there's one that means "feed the file to stdin."
And of course every browser no doubt handles this
issue differently; I don't know how you'd handle
this on IE, but there must be some way. What fun!
-- Joe
"Thanks to Microsoft, I am now blind in both eyes. They have
rolled back in my head so many times this week that they
are apparently stuck there now."
- Jonathan Rickman, regarding M$ anti-open-source PR.
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.
More information about the Ale
mailing list