Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Perlmonks Code Proxy

by nate (Monk)
on Aug 19, 2000 at 19:51 UTC ( [id://28644]=note: print w/replies, xml ) Need Help??

in reply to Perlmonks Code Proxy

It should work now if you click on the d/l code link on the bottom of any node that contains a <CODE> block.

Everything allows you to create different "htmlpages" for types, so we created a "document downloadcode page", with no nested containers around it:

[% my $text = $$NODE{doctext}; my $str; while($text=~/<CODE>((.|\n)*?)<\/CODE>/ig) { my $code = $1; $str.=$code."\n\n\n"; } $str; %]

All that was left was to hack in a change of content type to "application/octet" in the core, and viola!

Okay, merlyn's right. "text/plain" it is...

Replies are listed 'Best First'.
RE: Re: Perlmonks Code Proxy
by merlyn (Sage) on Aug 19, 2000 at 19:58 UTC
    Uh, what the heck is application/octet? Why not send it as it really is, text/plain, and that way it gets the right download type on every machine, and let me decide whether I want to see it in my browser, or dictate to my browser that I want to save it on disk?

    Yours for a better web,

    -- Randal L. Schwartz, Perl hacker

RE: Re: Perlmonks Code Proxy
by vroom (His Eminence) on Aug 19, 2000 at 22:06 UTC
    yeah that should have been application/octet-stream but text/plain works too

    vroom | Tim Vroom |
      Cool, now I can view it in my browser and cut/paste there, or hit option-click and it downloads as a nice Mac-OK text file! Thanks!

      -- Randal L. Schwartz, Perl hacker

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://28644]
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (1)
As of 2024-05-24 01:00 GMT
Find Nodes?
    Voting Booth?

    No recent polls found