Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: CGI-Attachment with many \0's

by eXile (Priest)
on May 06, 2004 at 17:25 UTC ( #351225=note: print w/replies, xml ) Need Help??

in reply to CGI-Attachment with many \0's


Are the files you add to the archive readable for the user-id the script runs under? Normally CGI scripts run under user 'nobody', so the files should at least be readable for this user.

Replies are listed 'Best First'.
Re: Re: CGI-Attachment with many \0's
by stefan k (Curate) on May 10, 2004 at 11:13 UTC
    yes, they are. Actually, the script first generates the files (using File::Temp::tempfile as a name generator) and then tries to pack them all together.

    Regards... Stefan
    you begin bashing the string with a +42 regexp of confusion

      mmm, at what point do you actually check if these files are there?

      What I'd do, because it is a strange problem, is use perl -d to step through your code on the box where the problem appears, maybe set a breakpoint just before the archive is created and at that point check if the files are there and what their size is (or add print/system commands in your source code to debug, depending on your debugging style).

      Another thing that might be going wrong when your script generates the files is that the file-content still is in the output buffer instead of on disk. You can set $|=1 to avoid this.

        first of thanks for staying with me for so long!

        Usually print is my debugger ;-) But in this case it makes little sense, since I know that the archive is created: it can be written to the local disk just fine.

        The problem only arises when the archive is delivered via Webserver, and even then only on one of two almost identical machines. Funny business, that is.

        Regards... Stefan
        you begin bashing the string with a +42 regexp of confusion

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://351225]
and one hand claps...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2017-05-25 00:48 GMT
Find Nodes?
    Voting Booth?