Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

Hi,

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.


Comment on Re: CGI-Attachment with many \0's
Re: Re: CGI-Attachment with many \0's
by stefan k (Curate) on May 10, 2004 at 11:13 UTC
    hi,
    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.

        Hi,
        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?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2014-11-25 22:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (160 votes), past polls