IIS 5.1 + Perl

J

John Bokma

Hi,

I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I added .pl, pointing to C:\perl\bin\perl.exe with "%s" %s added in the
mappings.

The ActiveState install seems to come with an IISmapping script, but I have
no clue on how to use it.

Any help is very welcome,


[1] Windows XP, SP2, default install.
 
A

A. Sinan Unur

I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I don't think this problem has anything to do with the web server your are
using, but rather with the fact that IE ignores text/plain, and tries to
deduce content type from the file extension.

On my system, I get the same response if I try to access the default
printenv.pl script that came with Apache.

If I change the content type to text/html, then the output of the script
is displayed in the browser window.

Sigh.

Sinan
 
J

John Bokma

A. Sinan Unur said:
I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I don't think this problem has anything to do with the web server your
are using, but rather with the fact that IE ignores text/plain, and
tries to deduce content type from the file extension.

On my system, I get the same response if I try to access the default
printenv.pl script that came with Apache.

If I change the content type to text/html, then the output of the
script is displayed in the browser window.

Sinan,

Many thanks, that did the trick. So much for
print "Content-type:text/plain\n\nHello, World!"; :-(
 
G

Gunnar Hjalmarsson

A. Sinan Unur said:
John said:
I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I don't think this problem has anything to do with the web server your are
using, but rather with the fact that IE ignores text/plain, and tries to
deduce content type from the file extension.

That fact makes it also not very helpful to deliver comments like this
to newbies:
http://groups.google.com/group/comp.lang.perl.misc/msg/259b0940fc4130e5

;-)
 
J

John Bokma

Gunnar Hjalmarsson said:
A. Sinan Unur said:
John said:
I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I don't think this problem has anything to do with the web server
your are using, but rather with the fact that IE ignores text/plain,
and tries to deduce content type from the file extension.

That fact makes it also not very helpful to deliver comments like this
to newbies:
http://groups.google.com/group/comp.lang.perl.misc/msg/259b0940fc4130e5

;-)

LOL :-D

Yup, to test Sinan's advice, I just lied about the content type :-D.
 
K

ko

John said:
Hi,

I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I added .pl, pointing to C:\perl\bin\perl.exe with "%s" %s added in the
mappings.

The ActiveState install seems to come with an IISmapping script, but I have
no clue on how to use it.

Any help is very welcome,


[1] Windows XP, SP2, default install.

CGI:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/Windows/
ActivePerl-Winfaq6.html#microsoft_web_servers

ASP:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/Windows/
ActiveServerPages.html


HTH - keith
 
J

John Bokma

ko said:
John said:
Hi,

I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I added .pl, pointing to C:\perl\bin\perl.exe with "%s" %s added in
the mappings.

The ActiveState install seems to come with an IISmapping script, but
I have no clue on how to use it.

Any help is very welcome,


[1] Windows XP, SP2, default install.

CGI:
http://aspn.activestate.com/ASPN/docs/ActivePerl/5.8/faq/Windows/
ActivePerl-Winfaq6.html#microsoft_web_servers

Yup, read that one, even the:

You need to follow these steps to get ActivePerl scripts to run under
IIS:
:
:
7. After you have made these changes, stop and restart the *Apache*
service.

:-D.


Thanks, that looks useful.

The problem I had was solved by not using text/plain as Sinan pointed
out. (So much for simple Hello, World! test scripts :-( )
 
A

Alan J. Flavell

I managed to get IIS 5.1 [1] running my hello.pl script in
Firefox. However, IE wants me to download it.

I don't think this problem has anything to do with the web server
your are using, but rather with the fact that IE ignores text/plain,
and tries to deduce content type
yes

from the file extension.

Sometimes - but it's a last resort after their other guesswork has
drawn a blank.

This crass violation of a mandatory requirement of RFC2616 has been
going on for a long time, and is one of the points on which MSIE
disqualifies itself as a web browser. It's a potential security
exposure (which was, I feel sure, the reason for RFC2616 insisting on
this point).

However, MS have stated that as from XP SP2, IE will honour the
text/plain content-type.
On my system, I get the same response if I try to access the default
printenv.pl script that came with Apache.

Sounds as if you're not up to date with MS software fixes :-{

See the highlighted bits regarding XP SP2 in
http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix_a.asp

(and google for "content-type saga" if you want to go into any
detail). At no point have I seen them admit that they are violating
the interworking specifications, but at least they did take out their
earlier mischievous cross-reference to RFC2616 (cited as if they might
be observing it, when in fact they were violating it).
If I change the content type to text/html, then the output of the script
is displayed in the browser window.

You (and anyone else concerned) should use a www-compatible browser.

Indeed.
 
A

A. Sinan Unur

A. Sinan Unur said:
John said:
I managed to get IIS 5.1 [1] running my hello.pl script in Firefox.
However, IE wants me to download it.

I don't think this problem has anything to do with the web server
your are using, but rather with the fact that IE ignores text/plain,
and tries to deduce content type from the file extension.

That fact makes it also not very helpful to deliver comments like this
to newbies:
http://groups.google.com/group/comp.lang.perl.misc/msg/259b0940fc4130e5

;-)

Point taken. Thanks.

Sinan
 
A

A. Sinan Unur

Sounds as if you're not up to date with MS software fixes :-{

Help -> About shows:

Version 6.0.2900.2180.xpsp2_gdr.050301-1519
Update Versions:; SP2;

I don't know how much more up-to-date I can be.

Sinan
 
A

Alan J. Flavell

Help -> About shows:

Version 6.0.2900.2180.xpsp2_gdr.050301-1519
Update Versions:; SP2;

I don't know how much more up-to-date I can be.

OK; then maybe MS haven't done what they appeared to be promising.
:-(

That "gdr" in the version string seems somehow apt...

When they said:

Note In Internet Explorer 6 for Microsoft Windows XP Service Pack 2
(SP2), the Multipurpose Internet Mail Extensions (MIME) type
"text/plain" is not ambiguous

I'm afraid I took "not ambiguous" to claim that they would now always
interpret text/plain as text/plain, whereas previously they had only
sometimes done so. Guess I should not have been so credulous.

I suppose "not ambiguous" *could* mean that they now claim always to
interpret text/plain as the same "thing", whatever that "thing" might
be, but that the "thing" is not what MIME defines to be text/plain.
Sigh.
 
J

John Bokma

[ text/plain ]
However, MS have stated that as from XP SP2, IE will honour the
text/plain content-type.

I quote my footnote in the OP:
"[1] Windows XP, SP2, default install."
Sounds as if you're not up to date with MS software fixes :-{

See the highlighted bits regarding XP SP2 in
http://msdn.microsoft.com/workshop/networking/moniker/overview/appendix
_a.asp

"is never rendered as HTML in the restricted zone"

I don't send HTML as text/plain, but text as text/plain, and IE wants to
download it :-(
You (and anyone else concerned) should use a www-compatible browser.

No, I (and anyone else concerning developing software for the public)
should make it work. There is little selling point if I can say to my
customer: hey, this works in www compatible browsers, so 90% of your
visitors have to switch :-D.
 
J

John Bokma

6.0.2900.2180.xpsp_sp2_gdr.050301-1519 (in case
someone searches for it)

(Don't you love not being able to copy text from an about box).
OK; then maybe MS haven't done what they appeared to be promising.
:-(

That "gdr" in the version string seems somehow apt...

I have it too :)
When they said:

Note In Internet Explorer 6 for Microsoft Windows XP Service Pack 2
(SP2), the Multipurpose Internet Mail Extensions (MIME) type
"text/plain" is not ambiguous

Read the rest: "is never rendered as HTML in the restricted zone"

Probably means that if you send out:

text/plain

<h1>Hello, world</h1>

It isn't rendered as HTML anymore.

Yes!
 
A

Alan J. Flavell

(Don't you love not being able to copy text from an about box).

Don't I just!!! I've considered installing text-recognition software
to read those damned things for quoting... (but never quite got a
Round Tuit).
Read the rest: "is never rendered as HTML in the restricted zone"

Elsewhere it says:

Note In Windows XP SP2, Internet Explorer will never upgrade a
file declared as a known type to a file type of higher privilege.
For example, a text/plain document will never be upgraded
^^^^^^^^^^^^
to text/html.

which seems to be yet another variation on their reality.

Quite what "the restricted zone" is doing in the first statement, if
the second statement is true as written, is left as an exercise to the
student.

Note the "for example", as if there are other possibilities (e.g
downgrading a text/plain document to an amorphous bag of bytes ?).

But they have promised us that text/plain is now "not ambiguous" - how
are we supposed to interpret that? If they aren't promising that it
can now only mean one thing - what *does* it mean?

Oh well, I suppose it's not worth worrying about - the only thing we
can be pretty sure about is that it still won't conform to the
interworking specifications (and probably never will).

(and so say all of us...)

cheers anyway.
 
A

Alan J. Flavell


With respect, I said "should".
I (and anyone else concerning developing software for the public)
should make it work.

But it *does* work, according to MS. It does what MS *want* it to do,
and their customers have chosen the MS product. Isn't that good
enough?
There is little selling point if I can say to my customer: hey, this
works in www compatible browsers, so 90% of your visitors have to
switch :-D.

It's doing just what MS have decided it should do. I didn't say they
*have to* switch - I only expressed the opinion that they should.

Oh, you meant you wanted IE to do what you *intended*? That's not
necessarily the same thing as "working", though. SCNR.

cheers
 
J

John Bokma

Alan J. Flavell said:
With respect, I said "should".


But it *does* work, according to MS.

What does wrok (didn't test it) is that if HTML is sent with text/plain
IE doesn't render it as HTML anymore.
It's doing just what MS have decided it should do. I didn't say they
*have to* switch - I only expressed the opinion that they should.

Oh, you meant you wanted IE to do what you *intended*? That's not
necessarily the same thing as "working", though. SCNR.

*sigh* What I mean is that:

a URI which ends in .pl sending text/plain should not start a download
in IE. This is plain wrong, and I think we agree on that one. However,
if I want IE to show plain text, I have to make it work.
 
J

John Bokma

Alan J. Flavell said:
Don't I just!!! I've considered installing text-recognition software
to read those damned things for quoting... (but never quite got a
Round Tuit).


Elsewhere it says:

Note In Windows XP SP2, Internet Explorer will never upgrade a
file declared as a known type to a file type of higher privilege.
For example, a text/plain document will never be upgraded
^^^^^^^^^^^^
to text/html.

which seems to be yet another variation on their reality.

Quite what "the restricted zone" is doing in the first statement, if
the second statement is true as written, is left as an exercise to the
student.

Note the "for example", as if there are other possibilities (e.g
downgrading a text/plain document to an amorphous bag of bytes ?).

No, since the sentence before says: *never* upgrade. The (one) example
is about upgrading plain to HTML. There are more upgrade examples
(excercise: think up a few :) ).
Oh well, I suppose it's not worth worrying about - the only thing we
can be pretty sure about is that it still won't conform to the
interworking specifications (and probably never will).

IE7, but I am not going to hold my breath :-D.
 
J

John Bokma

Todd W said:
I just played with my printenv.pl program and can also confirm the
behavior that people are seeing on Win2k SP4.

Changing the file extension to .cgi made it behave as desired, though.

Even more odd, but thanks for pointing that out.

so:

URI ends in .pl, MIME = text/plain -> IE downloads
URI ends in .cgi, MIME = text/plain -> IE renders plain text

I wonder what happens if one makes an association between .cgi extension
and perl.exe (like pl has)...
 
A

Alan J. Flavell

No, since the sentence before says: *never* upgrade.

Right, which can mean "leave the same, or sometimes downgrade". The
latter is what seems to be getting reported here, I thought, and
that's the point that I was trying to make, despite their claim that
it's "not ambiguous".
There are more upgrade examples (excercise: think up a few :) ).

Of course; but it's what they *don't* say that is often the important
part of the message.

best regards
 

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

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top