in reply to POSTing from one script to another

I think you are trying to test two scripts at the same time.

That is a bad idea, because when you're debugging something like that, it is very hard to pin down where the problem is.

First question you should ask yourself is: can an ordinary browser upload a file to my file-receiver module? If it can't, work on the server part until file uploads succeed. Once that is done, you can concentrate on the script you wrote for uploading the files.

This is a special case of one of the fundamental rules of debugging: "never change more than one thing between test runs".

Replies are listed 'Best First'.
Re: Re: POSTing from one script to another
by Anonymous Monk on May 05, 2004 at 12:23 UTC
    My receiving script works fine so I'm not really debugging 2 scripts. I verified the receiving script using a normal HTML multipart/form-data form to post to it. The problem lies with the sending script, which I've been fiddling with for awhile now. I checked the server log: no requests for the 2nd script! Also, no 501 errors. This leads me to conclude that the request isn't even happening. It's dying right after or during the actual LWP/UA request. I read that the header "Client-Warning" is generated by LWP. If this is true, then perhaps there's really something wrong at the sender side? Perhaps a misconfig of the server?
      Ah, concentrating on the uploader, I see that you are specifying Content-type as 'form-data'.

      That is incorrect. It should be 'multipart/form-data'.

        Are you sure? I got the syntax straight from Gisle Aas's HTTP::Request::Common doc...
        Anyway I believe form-data and multipart/form-data are interchangable, since the request header shows "Content-type: multipart/form-data". So I assume both get transposed into the correct Content-type header.