note 117990 added to function.curl-setopt
| From: | alvaro at demogracia dot com | Date: | Tue, 15 Sep 2015 12:14:47 +0000 |
| Subject: | note 117990 added to function.curl-setopt | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-203785@lists.php.net to get a copy of this message | ||
With the legacy file upload feature, Curl sends the file name of the actual file and there
isn't a documented way to change that behaviour. If you aren't able to use the CURLFile
class there's a workaround that apparently works: append "; filename=" after the
value (and make sure it comes after "type=").
<?php
$postfields = array(
'document[]' => '@/tmp/upload_qm5ee8FBxi; type=image/jpeg;
filename=Kitten.jpg',
);
----
Server IP: 72.52.91.14
Probable Submitter: 212.183.207.73
----
Manual Page -- http://php.net/manual/en/function.curl-setopt.php
Edit -- https://master.php.net/note/edit/117990
Del: integrated -- https://master.php.net/note/delete/117990/integrated
Del: useless -- https://master.php.net/note/delete/117990/useless
Del: bad code -- https://master.php.net/note/delete/117990/bad+code
Del: spam -- https://master.php.net/note/delete/117990/spam
Del: non-english -- https://master.php.net/note/delete/117990/non-english
Del: in docs -- https://master.php.net/note/delete/117990/in+docs
Del: other reasons-- https://master.php.net/note/delete/117990
Reject -- https://master.php.net/note/reject/117990
Search -- https://master.php.net/manage/user-notes.php