cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl_formadd and file uploads

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sun, 14 Apr 2002 09:39:20 +0200 (MET DST)

On Fri, 12 Apr 2002, Craig Davison wrote:

> Is there a way to get curl_formadd to report file I/O errors (such as file
> not found)? I'm passing obvious fake filenames along with the CURLFORM_FILE
> option and no errors are reported.

I agree with you that it would make sense. Currently, it only adds the file
name to a linked list and then it tries to read the file later, when making
the actual post...

We should add some file-is-present checks to the CURLFORM_FILE and
CURLFORM_FILECONTENT code.

You up to providing a patch for this?

> Also, I'm not clear from the documentation what CURLFORM_FILECONTENT does
> exactly. Can anyone clear that up?

It is actually kind of unnecessary. It allows you to specify a "normal"
formpart that gets its contents from a file. So instead of using
CURLFORM_PTRCONTENTS or CURLFORM_COPYCONTENTS, you can tell libcurl to read
the contents off a file instead, using CURLFORM_FILECONTENT.

-- 
    Daniel Stenberg -- curl groks URLs -- http://curl.haxx.se/
Received on 2002-04-14