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

curl-and-php

Re: PHP - Curl and Multipart Form File Upload

From: Daniel Stenberg <daniel_at_haxx.se>
Date: Sat, 22 Nov 2008 22:39:24 +0100 (CET)

On Thu, 20 Nov 2008, Andrey Kuznetsov wrote:

> curl_setopt($docurl, CURLOPT_POSTFIELDS, array("userfile"=>"{@picture.JPG}"));
> $webpage = curl_exec($docurl);

AFAIK, the magic key here is to let the name start literally with a '@' and
the rest being a file name. Staring it with '{' will just make that string be
included as text.

See the example here:

         http://curl.haxx.se/libcurl/php/examples/multipartpost.html

-- 
  / daniel.haxx.se
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-11-22