<?xml version="1.0" encoding="windows-1252"?>
<node id="351114" title="Re: Re: CGI-Attachment with many \0's" created="2004-05-06 09:55:10" updated="2005-06-21 03:54:34">
<type id="11">
note</type>
<author id="5094">
stefan k</author>
<data>
<field name="doctext">
Hi,
&lt;p&gt;
&lt;em&gt;Have you tried getting the script to write the file to disk&lt;/em&gt;
&lt;p&gt;
Yes
&lt;p&gt;
&lt;em&gt;can this file be retrieved by the clients correctly?&lt;/em&gt;
&lt;p&gt;
Yes, I've written that file to the /tmp-Dir, copied it to the HTTPD-root-directory accessed it directly and could download it just fine.
&lt;p&gt;
&lt;em&gt;
have you tried having the script simultaniously write a copy of the file and return it to the client? &lt;/em&gt;
&lt;p&gt;
No, I am using the following code:
&lt;code&gt;
  my $tar = Archive::Tar-&gt;new;
  # ...
  # in a loop:
  $tar-&gt;add_files("$filename");
  # ...
  my $data = $tar-&gt;write();
  print $q-&gt;header(-type =&gt; 'application/octet-stream',
                   -attachment =&gt; "edi.tar");
  print $data;
&lt;/code&gt;

And remember: it works fine on two out of three machines.  That is what makes me wonder so much.
&lt;div class="pmsig"&gt;
&lt;div class="pmsig-5094"&gt;
&lt;p&gt;
&lt;table width="80%" border="0" cellspacing="0" cellpadding="0"&gt;
&lt;tr&gt;
&lt;td&gt;&lt;small&gt;Regards...&lt;/small&gt;&lt;/td&gt;
&lt;td align="right"&gt;&lt;small&gt;
&lt;a href="http://www.skamphausen.de"&gt;Stefan&lt;/a&gt;
&lt;/small&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td colspan="2" align="center"&gt;
&lt;small&gt;you begin bashing the string with a +42 regexp of confusion&lt;/small&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/table&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
351105</field>
<field name="parent_node">
351107</field>
</data>
</node>
