in reply to HTTP Headers Problem

Can you specify the website so I can test a script or post the code you are using? I presume you are using LWP::UserAgent and HTTP::Request something like this:

use LWP::UserAgent; use HTTP::Request::Common qw(POST); $ua = new LWP::UserAgent; $req = POST ( 'http://www.page.com/app?cmd=upload', Content_Type => 'form-data', Content => [ name => 'value', name => 'value', file => ["/path/to/file.txt"], ] ); $response = $ua->request($req);

Update

Website remains down. This code seems to check out OK.
$filename = "c:/test.pl"; use HTTP::Request::Common qw(POST); use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = POST ('http://www.environet.gov.on.ca/dwws-app/DWWSApp?cmd=U +ploadSubmPage.uploadSubm', Content_Type => 'form-data', Content => [ works_id => '2353245', lab_id => '456436', filename => [$filename] ] ); print $req->as_string; # looks OK my $res = $ua->request($req); print $res->as_string;

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print

Replies are listed 'Best First'.
Re: Re: HTTP Headers Problem
by gr0f (Acolyte) on Aug 27, 2001 at 18:19 UTC
    Sure can, refer to the above reply to tomhukins...
Re: Re: HTTP Headers Problem
by gr0f (Acolyte) on Aug 27, 2001 at 23:35 UTC
    Ok, I still seem to be getting the same error, but at least this time I can see the headers. Here is a header that was generated for one of the files I uploaded:
    POST http://www.environet.gov.on.ca/dwws-app/DWWSApp?cmd=UploadSubmPag +e.uploadSubm Content-Length: 11052 Content-Type: multipart/form-data; boundary=xYzZY --xYzZY Content-Disposition: form-data; name="works_id" 210000586 --xYzZY Content-Disposition: form-data; name="lab_id" 48 --xYzZY Content-Disposition: form-data; name="filename"; filename="210000586-2 +10001130.txt" Content-Length: 10761 Content-Type: text/plain
    And this is the error that the website sent me back:
    Malformed line after disposition: Content-Length: 10761
    Arrrgh, I hate this site ;) It's given me nothing but problems...

    -Tim