|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2018-12-08 01:09 UTC] ab@php.net
-Status: Open
+Status: Not a bug
[2018-12-08 01:09 UTC] ab@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 20:00:01 2025 UTC |
Description: ------------ cURL cannot upload files with filenames containing unicode characters. 5.6.38, 7.0.32: upload is successful 7.1.25, 7.2.13, 7.3.0: upload failed Test script: --------------- $test_file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . '✄♚♛♜♞PHP' . PHP_VERSION . PHP_OS . '.txt'; file_put_contents($test_file, 'test') or exit('file_put_contents failed'); register_shutdown_function(function() use ($test_file) { unlink($test_file); }); $curl = curl_init('http://localhost/upload.php'); curl_setopt_array($curl, [ CURLOPT_POST => TRUE, CURLOPT_SAFE_UPLOAD => TRUE, CURLOPT_POSTFIELDS => ['file' => curl_file_create($test_file)], CURLOPT_RETURNTRANSFER => TRUE, CURLOPT_HEADER => TRUE ]); $got = curl_exec($curl); var_dump($got, curl_error($curl), curl_getinfo($curl), PHP_VERSION); ---------------- upload.php: --- var_dump($_FILES); Expected result: ---------------- HTTP/1.1 200 OK Date: Fri, 07 Dec 2018 13:40:12 GMT Server: Apache Vary: Accept-Encoding Content-Length: 284 Content-Type: text/html; charset=utf-8 array(1) { ["file"]=> array(5) { ["name"]=> string(33) "✄♚♛♜♞PHP7.3.0WINNT.txt" ["type"]=> string(24) "application/octet-stream" ["tmp_name"]=> string(29) "D:\TMP\php8BF9.tmp" ["error"]=> int(0) ["size"]=> int(4) } }