in reply to Re: amelinda's HTTP/MIME/file upload/not-a-cgi-but-a-client/minimal-module/perl problem
in thread amelinda's HTTP/MIME/file upload/not-a-cgi-but-a-client/minimal-module/perl problem

Right. That's why the next line is $len += 514;. It accounts for those extra bits (since they remain constant throughout all invocations of the code).
  • Comment on RE: Re: amelinda's HTTP/MIME/file upload/not-a-cgi-but-a-client/minimal-module/perl problem
  • Download Code

Replies are listed 'Best First'.
RE: RE: Re: amelinda's HTTP/MIME/file upload/not-a-cgi-but-a-client/minimal-module/perl problem
by Fastolfe (Vicar) on Sep 30, 2000 at 04:15 UTC
    We've been going back and forth in the Chatterbox for a bit, and I know you're pretty sure that 514 number is accurate, but I still think it isn't. I modified your code to append everything after your HTTP headers to $data, and added these two lines:
    print "\$len=$len\n"; print "data length=" . length($data) . "\n";
    Now in theory, these should be the same, but they aren't:
    (fastolfe) eddie:~$ perl test user password test.file $len=555 data length=580
    Try adding 25 to your number and see if your problem goes away.. *shrug*.
      I changed the code so that it puts the entire output into a string, does a $len = (length $output), and then prints $len and $output. If that isn't the right number, I'll eat my hat*.

      amelinda

      * I am prefectly safe in this, as I own no hats. No, wait, I own a pith helmet, and I'm not going to eat that... uhm, if that isn't the right number, I'll eat.... soybeans, yeah that's it.**

      ** Mmmmm, edomame.

        Could this be a buffering issue?
        select(OUT); $|=1; select(STDOUT);
        And from this post can I infer that your data is still getting truncated by the time the server/CGI sees it?
RE: RE: Re: amelinda's HTTP/MIME/file upload/not-a-cgi-but-a-client/minimal-module/perl problem
by Fastolfe (Vicar) on Sep 30, 2000 at 03:13 UTC
    Oh.