Code sent (completely official example) {code ...} receive code (also official) {code ...} running result {code ...} I was going to post php. ini configuration, but the upload location is not found. Let's take a look at the configurations that I need to post as soon as possible. Curl_setopt ($ ch, CURLO... code sent (completely official example)
'Foo', 'file' => '@/home/vagrant/test.png');curl_setopt($ch, CURLOPT_URL, 'http://localhost/test/curl/load_file.php');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_exec($ch);?>
Receive code (also official)
Running result
php -f demo.php Array( [name] => Foo [file] => @/home/vagrant/test.png)Array()
I was prepared to paste the php. ini configuration, but I couldn't find the upload location. Let's take a look at the configurations that I need to post as soon as possible.
Curl_setopt ($ ch, CURLOPT_VERBOSE, TRUE.
Reply content:Code sent (completely official example)
'Foo', 'file' => '@/home/vagrant/test.png');curl_setopt($ch, CURLOPT_URL, 'http://localhost/test/curl/load_file.php');curl_setopt($ch, CURLOPT_POST, 1);curl_setopt($ch, CURLOPT_POSTFIELDS, $data);curl_exec($ch);?>
Receive code (also official)
Running result
php -f demo.php Array( [name] => Foo [file] => @/home/vagrant/test.png)Array()
I was prepared to paste the php. ini configuration, but I couldn't find the upload location. Let's take a look at the configurations that I need to post as soon as possible.
Curl_setopt ($ ch, CURLOPT_VERBOSE, TRUE.
$ Ch = curl_init (); $ data = array ('name' => 'foo', 'file' => '@/home/vagrant/test.png '); curl_setopt ($ ch, CURLOPT_URL, 'HTTP: // localhost/test/curl/load_file.php '); curl_setopt ($ ch, CURLOPT_POST, 1); curl_setopt ($ ch, CURLOPT_SAFE_UPLOAD, false); // if the value 5.6 is set to true, get back to curl_setopt ($ ch, CURLOPT_POSTFIELDS, $ data); curl_exec ($ ch);?>
Found in sf: Consider PHP 5.0 ~ 5.6 cross-version compatibility cURL File Upload
It looks good.