Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Re^2: Force Download to a .xls file

by existem (Sexton)
on Feb 16, 2005 at 12:39 UTC ( #431543=note: print w/replies, xml ) Need Help??

in reply to Re: Force Download to a .xls file
in thread Force Download to a .xls file

Just as a little side not to all this, i've finally managed to get it to work using this notation.

print "Content-type: application/\n"; print "Content-Disposition: attachment; filename=$filename\n"; print "\n"; open TMP, "$directory/$filename" or die "Error message here: $!\n"; binmode TMP; binmode STDOUT; print <TMP>;

Please note that the first bit just uses the basename of the file, so without the whole directory path. Whereas the second bit uses the $directory path so it's absolute on the file system. This little thing had me stumped for a while there, so thought i'd share incase others have the same problem.

Best of luck,

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2022-08-14 07:28 GMT
Find Nodes?
    Voting Booth?

    No recent polls found