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/vnd.ms-excel\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, Tom
-
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.
|