Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
Maybe this is a mod_perl issue, but I need to have a user download a dynamically created spreadsheet. (created using Spreadsheet::WriteExcel)

Basically, here is how it should go..
Click link to download sheet
mod_perl module pulls q's from the DataBase,
Prints "Content-type: application/excel(or some needed varient)"
Prints "Content-Disposition: inline; filename=$name"
Then the spreadsheet is opened like so...
my $workbook = Spreadsheet::WriteExcel->new("-");


Only, the data isnt sent to the browser. Now, maybe I'm quite young with this stuff but I'd think since I set the Content-type headers that it would prompt the user to save the file.

It works outside of mod_perl

I have been reading about 'headers_out()' and 'send_httpd_header'(I believe thats what it was...) and have gotten just about nowhere. I've got the Eagle book, on mod_perl, and cant seem to find anything on Disposition. There is a discussion here on the mod_perl archives that is similar, but doesnt seem to offer me a solution.

In httpd.conf I have:
PerlSendHeader On
but is that needed? I read that in a discussion somewhere. Has anybody done this before? I mean, I'm sure somebody has, but umm, how did they do it?
Regardless, thanks for pointing me in the right direction if its at all possible.

_14k4 - webmaster@860.org (www.poorheart.com)

In reply to Using Spreadsheet::WriteExcel with mod_perl and Content-Disposition? by one4k4

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



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-24 01:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found