Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: How to download a file from the server (content disposition CGI->header( qw{ -type mime/type -attachment filename } ) )

by Anonymous Monk
on Jul 23, 2013 at 12:05 UTC ( [id://1045843]=note: print w/replies, xml ) Need Help??


in reply to How to download a file from the server

computers/HTTP doesn't like typos

$ perl -MCGI -le " print CGI->header( qw{ -type mime/type -attachment +filename } ) " Content-Disposition: attachment; filename="filename" Content-Type: mime/type

Using Spreadsheet::WriteExcel with mod_perl and Content-Disposition?, Content-Disposition... odd behavior in IE

  • Comment on Re: How to download a file from the server (content disposition CGI->header( qw{ -type mime/type -attachment filename } ) )
  • Download Code

Replies are listed 'Best First'.
Re^2: How to download a file from the server (content disposition CGI->header( qw{ -type mime/type -attachment filename } ) )
by ghosh123 (Monk) on Jul 23, 2013 at 13:12 UTC

    Sorry , I did not get how to use it and it still not working. Can you please elaborate ?

      Sorry , I did not get how to use it and it still not working. Can you please elaborate ?

      The code you posted, the headers it generates, doesn't match the headers CGI::header generates

        Hi ,
        The downloading is working now for simple text files. For downloading excel file (.xls) I am using the following content but the files are getting downloaded of 0 bytes size and corrupted.
        I am using following content type for excel but of no use. Please help.

        print "Content-Type:application/vnd.ms-excel\n"; print "Content-Disposition:attachment;filename=data.xls\n\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-19 19:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found