1--TEST--
2CURL file uploading from stream
3--EXTENSIONS--
4curl
5--FILE--
6<?php
7include 'server.inc';
8$host = curl_cli_server_start();
9
10$ch = curl_init();
11curl_setopt($ch, CURLOPT_SAFE_UPLOAD, 1);
12curl_setopt($ch, CURLOPT_URL, "{$host}/get.inc?test=file");
13curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
14
15$file = curl_file_create('data://text/plain;base64,SSBsb3ZlIFBIUAo=', 'text/plain', 'i-love-php');
16$params = array('file' => $file);
17var_dump(curl_setopt($ch, CURLOPT_POSTFIELDS, $params));
18
19var_dump(curl_exec($ch));
20curl_close($ch);
21?>
22--EXPECT--
23bool(true)
24string(24) "i-love-php|text/plain|11"
25