in reply to Redirect to an XLSX spreadsheet

Sounds like your server is setup to execute things in the /cgi-bin so it’s treating the .xlsx file as a script the server can run and it’s erroring when it tries. Try saving the file to a plain document directory (where you already have images/html/etc) and redirecting to that location. A more straightforward approach (unless the files are HUGE) might be to serve it directly as an attachment. E.g.,

print $cgi->header( -type => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' );

…and then print the file to STDOUT. Search here: https://www.google.com/search?q=site%3Aperlmonks.org+attachment+cgi&oq=site%3Aperlmonks.org+attachment+cgi.

Replies are listed 'Best First'.
Re^2: Redirect to an XLSX spreadsheet
by rbholder (Initiate) on Sep 15, 2014 at 19:43 UTC

    Thank you for your response, venerable Monk !

    I haven't tried the attachment yet but that sounds intriguing. I cheated and just took the last x off the filename. So I can redirect to /cgi-bin/temp/filename.xls but not /cgi-bin/temp/filename.xlsx. Still think it's an AddHandler or AddType thang. Thanks again for your help.