Hello there nadarajan, search is translation, its lookup like dictionary, try it like this  [ddg://site:perlmonks.org Content-Disposition: attachment; filename],  [google://site:perlmonks.org Content-Disposition: attachment; filename], [Content-Disposition: attachment; filename] site:perlmonks.org Content-Disposition: attachment; filename, site:perlmonks.org Content-Disposition: attachment; filename, Content-Disposition: attachment; filename -> Content-Disposition... odd behavior in IE, Re: How to download a file from the server (content disposition CGI->header( qw{ -type mime/type -attachment filename } ) )

raw "cgi"

#!/usr/bin/perl -- use strict; print "Content-type: application/octet-stream\n"; print "Content-disposition: attachment; filename=big-test.csv\n\n"; print "Test,One,Two,Three\n"; exit;
PSGI/Plack
my $app = sub { return [ ## response [ ## headers 'Content-Disposition' => 'attachment; filename="$filename" +', 'Content-length' => '3', 'Content-Type' => '$mimetype', ], [ ## content 123 ] ]; };

CGI.pm objects!(yes)

#!/usr/bin/perl -- use strict; use warnings; use CGI ( ); binmode STDOUT; my $q = CGI->new; print $q->header( -type => $mimetype, -attachment => $filename, -Content_length => -s $filehandle, ); ...

CGI.pm functional

#!/usr/bin/perl -- use strict; use warnings; use CGI qw( param header ); binmode STDOUT; print header( -type => $mimetype, -attachment => $filename, -Content_length => -s $filehandle, ); ...

important details

Copy/paste from Re: To call a .pl file when a button is pressed on a GUI created using Perl CGI (webserver) for the links below

Its simple, you need a webserver

Why? Because webpages and CGI needs a webserver, thats how it works

Its weird that so many folks manage to create a GUI using Perl CGI without understanding this

learn about the internet,Web Programming: For Beginners, to get an overall picture of how the internet works, how tcp/ip, sockets, html, ajax, all fit together....

See also Mojolicious::Lite +and jQuery +AJAX + Mojo::Template

And a copy-pasta for you:)

Also, there are checklists for that , Basic debugging checklist , brian's Guide to Solving Any Perl Problem, CGI Help Guide , Troubleshooting Perl CGI scripts

Yes, work through these checklists, when you find a problem on the list, use a solution from the list, when you find a problem not on the list (rare), post the error message and problem description here

brian's Guide to Solving Any Perl Problem, CGI Help Guide , Troubleshooting Perl CGI scripts

So examine your server configuration and compare to https://httpd.apache.org/docs/2.2/howto/public_html.html#cgi / Apache Tutorial: Dynamic Content with CGI

learn about the internet,Web Programming: For Beginners, to get an overall picture of how the internet works, how tcp/ip, sockets, html, ajax, all fit together.


In reply to Re: Need help in translating the following php code to perl (search!) by Anonymous Monk
in thread Need help in translating the following php code to perl by nadarajan

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.