note 108659 deleted from function.curl-setopt by danbrown
| From: | danbrown@php.net | Date: | Tue, 15 May 2012 17:42:49 +0000 |
| Subject: | note 108659 deleted from function.curl-setopt by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-187992@lists.php.net to get a copy of this message | ||
Note Submitter: Trenton
----
In response to the note above about sending the full path name when posting a file:
<?php
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file' => '@/path/to/file.ext');
?>
Rather than changing the current directory, you can specify an alternate pathname like so:
<?php
curl_setopt($ch, CURLOPT_POSTFIELDS, array('file' =>
'@/path/to/file.ext;filename=different_name.ext');
?>