Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2018-04-21 17:59 GMT
Find Nodes?
    Voting Booth?