note 15603 modified in function.curl-setopt by danbrown

From: Date: Sun, 17 May 2009 17:38:35 +0000
Subject: note 15603 modified in function.curl-setopt by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-155008@lists.php.net to get a copy of this message
To make a POST in multipart/form-data mode (to upload a file for example) you can use <?php curl_setopt($ch,CURLOPT_POSTFIELDS,$post); ?> where $post is an array : <?php $post['key1'] = 'data1'; // like a text field in a POST $post['file1'] = '@filename1' // upload filename1 ?> For more informations see the curl_formparse man page. --was-- To make a POST in multipart/form-data mode (to upload a file for example) you can use curl_setopt($ch,CURLOPT_POSTFIELDS,$post); where $post is an array : $post['key1'] = 'data1' // like a text field in a POST $post['file1'] = '@filename1' // upload filename1 For more informations see the curl_formparse man page. http://php.net/manual/en/function.curl-setopt.php

« previous php.notes (#155008) next »