CGI.pm File Upload doesn't work (blocks) on my Server (but workson my Desktop)

Discussion in 'Perl Misc' started by Bjoern, Oct 12, 2003.

  1. Bjoern

    Bjoern Guest

    Hello,

    my script handles file uploads (using CGI.pm) fine on my Windows Desktop
    (with Apache 1.3.28), but it seems to hang on my Linux Server (debian,
    Apache 1.3.26). I think it is actually never called, as I don't get any
    logging output, either.

    What coud be wrong? I've checked that /temp can be written to by anyone,
    but other than that, I have no idea. Other scripts in the same directory
    and with the same permissions work fine.

    Many thanks in advance for any ideas!


    Bjoern


    P.S.: Because I was drowning in spam, replying to this email will only
    trigger an automated reply that will give you my active email address.
    Sorry for the inconvenience.



    --


    Let's not weep for their evil deeds,
    but for their lack of imagination
    (Nick Cave)
     
    Bjoern, Oct 12, 2003
    #1
    1. Advertising

  2. Bjoern

    mike Guest

    Re: CGI.pm File Upload doesn't work (blocks) on my Server (but works on my Desktop)

    "Bjoern" <> wrote in message
    news:bmcjs3$l8nhd$-berlin.de...
    > Hello,
    >
    > my script handles file uploads (using CGI.pm) fine


    How? Posting code would be a good start.
     
    mike, Oct 13, 2003
    #2
    1. Advertising

  3. Bjoern

    Guest

    Re: CGI.pm File Upload doesn't work (blocks) on my Server (but works on my Desktop)

    Bjoern <> wrote:
    > What coud be wrong? I've checked that /temp can be written to by anyone,


    There is no /temp on a standard unix or gnu/linux distribution.

    Chris
    --
    @s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
    until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}
     
    , Oct 13, 2003
    #3
  4. Bjoern

    Bjoern Guest

    wrote:
    > Bjoern <> wrote:
    >
    >>What coud be wrong? I've checked that /temp can be written to by anyone,

    >
    >
    > There is no /temp on a standard unix or gnu/linux distribution.


    oops, true - but there is a /tmp, which is what I meant.

    I'll try to create a simple script that reproduces my problem and that I
    can post.


    Bjoern


    --


    Let's not weep for their evil deeds,
    but for their lack of imagination
    (Nick Cave)
     
    Bjoern, Oct 13, 2003
    #4
  5. Bjoern

    Bjoern Guest

    mike wrote:

    > "Bjoern" <> wrote in message
    > news:bmcjs3$l8nhd$-berlin.de...
    >
    >>Hello,
    >>
    >>my script handles file uploads (using CGI.pm) fine

    >
    > How? Posting code would be a good start.


    OK, made a short version now, and it seems as if CGI.pm is not at fault.
    I don't think the script is even ever called, as even if I point the
    upload form to a non-existant script, it still blocks forever.

    So you'll probably tell me to go away. But for what it's worth, here the
    test page and code:

    ---------- page -----------------

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/transitional.dtd">
    <html> <head>
    <link rel="stylesheet" type="text/css" href="../../arcus.css">
    <title>Arcus Investment</title>
    </head>
    <body>
    <form name="upload" action="cgi-bin/uploadTest.pl" method="post"
    enctype="multipart/form-data">
    test:
    <input type=file size="40" name="test">
    <input type="submit" value="submit">
    </form>
    </body>
    </html>


    ----------- Script -----------

    #!/usr/bin/perl

    use CGI; # load CGI routines
    $q = new CGI;

    print $q->header(-type => 'text/html');

    my $test = $q->upload('test');

    while(<$test>){
    print;
    }

    print "perl cgi test ok";



    --


    Let's not weep for their evil deeds,
    but for their lack of imagination
    (Nick Cave)
     
    Bjoern, Oct 13, 2003
    #5
  6. On Mon, 13 Oct 2003, Bjoern wrote:

    > OK, made a short version now, and it seems as if CGI.pm is not at fault.
    > I don't think the script is even ever called, as even if I point the
    > upload form to a non-existant script, it still blocks forever.
    >
    > So you'll probably tell me to go away.


    If you think that you don't primarily have a Perl language problem
    here, you're probably right. If you think that you'd get a better
    answer to your HTML authoring and/or web server configuration problems
    on a more appropriate group, you'd probably be right. If you think
    that we don't care whether you succeed or not, you're probably wrong.
    We _do_ like to see folks getting good results, but we're happier when
    we see them going about it in the right way.

    [snip]

    > <form name="upload" action="cgi-bin/uploadTest.pl" method="post"
    > enctype="multipart/form-data">


    Looks promising, but are you sure what absolute URL that relative
    URLpath "cgi-bin/uploadTest.pl" is going to resolve to?

    > ----------- Script -----------
    >
    > #!/usr/bin/perl


    Guess who isn't paying proper attention to this group's posting
    guidelines? The regulars hate that. It's demeaning for a human being
    to be asked to do the job of a machine.

    I don't see anything obvious that leaps out at me.

    What you've omitted to tell us is what you observed when you tried it.

    Take a look at those guidelines - use strict and warnings - in this
    context I'd also recommend making use of CGI::Carp to get any
    diagnostics back to the browser while testing (take it out again
    before opening the web site to the public - no need to expose internal
    details to hackers...)

    good luck
     
    Alan J. Flavell, Oct 13, 2003
    #6
  7. Bjoern

    Bjoern Guest

    Alan J. Flavell wrote:
    > On Mon, 13 Oct 2003, Bjoern wrote:
    >
    >
    >>OK, made a short version now, and it seems as if CGI.pm is not at fault.
    >>I don't think the script is even ever called, as even if I point the
    >>upload form to a non-existant script, it still blocks forever.
    >>
    >>So you'll probably tell me to go away.


    [...]

    OK, the problem cause is really embarrassing: apparently my desktop
    computers firewall (Kerio) was blocking the file uploads. I still don't
    know why, because it let's other http requests pass, but at least I can
    test my script by temporarily disabling the firewall.

    So it wasn't perl-related after all. But for completeness sake I wanted
    to post the solution here anyway, in case somebody with a similiar
    problem is searching the archives.

    [...]

    >>----------- Script -----------
    >>
    >>#!/usr/bin/perl

    >
    >
    > Guess who isn't paying proper attention to this group's posting
    > guidelines? The regulars hate that. It's demeaning for a human being
    > to be asked to do the job of a machine.


    I am not sure what I did wrong here? I was asked to post code, and in
    the guidelines I just found: "First make a short (less than 20-30 lines)
    and complete program that illustrates the problem you are having. People
    should be able to run your program by copy/pasting the code from your
    article.". Or is it that the #!/usr/bin/perl doesn't belong into the script?

    Just trying to understand? Sorry I didn't read the guidelines
    beforehand, but it isn't obvious to look for 'guidelines', I only
    searched for the faq.

    Thanks for all the helpful replies!


    Bjoern

    --


    Let's not weep for their evil deeds,
    but for their lack of imagination
    (Nick Cave)
     
    Bjoern, Oct 14, 2003
    #7
  8. On Tue, 14 Oct 2003, Bjoern wrote:

    > OK, the problem cause is really embarrassing:


    Don't worry about it! We all make mistakes. Main thing is, you've
    learned something about debugging for next time, and we've got the
    satisfying sense of closure that comes from hearing how the problem
    panned out in the end.

    > apparently my desktop
    > computers firewall (Kerio) was blocking the file uploads. I still don't
    > know why, because it let's other http requests pass, but at least I can
    > test my script by temporarily disabling the firewall.
    >
    > So it wasn't perl-related after all. But for completeness sake


    Indeed. Thanks for posting the update!

    > >>----------- Script -----------
    > >>
    > >>#!/usr/bin/perl

    > >
    > > Guess who isn't paying proper attention to this group's posting
    > > guidelines? The regulars hate that. It's demeaning for a human being
    > > to be asked to do the job of a machine.

    >
    > I am not sure what I did wrong here?


    Specifically: you didn't have strict and warnings enabled...

    all the best
     
    Alan J. Flavell, Oct 14, 2003
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. TC
    Replies:
    4
    Views:
    666
    JohnnyAppleseed
    Feb 7, 2005
  2. Arjen
    Replies:
    3
    Views:
    446
    Scott Allen
    Feb 27, 2005
  3. matt
    Replies:
    1
    Views:
    270
    George Ogata
    Aug 6, 2004
  4. srini
    Replies:
    1
    Views:
    94
    Tore Aursand
    Aug 18, 2004
  5. iMath
    Replies:
    7
    Views:
    1,887
    iMath
    Nov 10, 2013
Loading...

Share This Page