cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Re: File Postilating Errornation

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Thu, 5 Jun 2003 14:29:31 +0200 (CEST)

On Wed, 4 Jun 2003, Steve Keller wrote:

> > This is causing a rfc1867 (multpart) formpost. Is that really what you
> want?
>
> Well, I'll admit, you've got me there. I always thought there was only one
> kind of multi-part post :)

Sorry, I didn't mean to imply that there are several types of multi-part
posts, only that multi-part posts differ from "normal" posts.

> I've tried setting CURLOPT_POST to do an URL-encoded post, but get the same
> result. What would you suggest?

Yes, but as the form you want to automate really is a multi-part you won't
suuceed with that! ;-)

> Aye, there's my trouble. I have a feeling nobody's done this before with
> NetLedger

Sometimes is the first time for every web site. In 99.98% of the times, we
can still get curl to do the job, given a little sweat and research.

> There's little or no documentation on actually sending server-to-server
> posts in their development docs.

The uploader behaves exactly like a client here.

> <form id='main_form' name='main_form' method='post'
> enctype="multipart/form-data"
> action='/app/external/xml/upload/upload.nl?mtype=XMLDOC&outfile=true'>

This is not the same URL what you used in the script you showed us. This is
the one you should be using.

> <input class='text' type="file" name="mediafile">

I think you got this field right.

> <INPUT type='submit' class='bgbutton' value='Submit' id='submitter'
> name='submitter'>

You set 'submit=1' when this tag says it should be 'submitter=Submit'...

> <INPUT type='button' class='bgbutton' value='Reset' id='resetter'
> name='resetter'>

This field should be left out.

> I used the same field names and changed the destination URL, although I
> just noticed the query fields there, and I'm wondering if I should try
> them.

You should use the exact ones that are used in the <form> tag as that's what
your browser uses and you says it works with that, right?

-- 
 Daniel Stenberg -- curl: been grokking URLs since 1998
-------------------------------------------------------
This SF.net email is sponsored by:  Etnus, makers of TotalView, The best
thread debugger on the planet. Designed with thread debugging features
you've never dreamed of, try TotalView 6 free at www.etnus.com.
Received on 2003-06-05