xref: /php-src/ext/curl/tests/bug77711.phpt (revision 8567bc10)
1--TEST--
2FR #77711 (CURLFile should support UNICODE filenames)
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.php?test=file");
13curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
14
15$filename = __DIR__ . '/АБВ.txt';
16file_put_contents($filename, "Test.");
17$file = curl_file_create($filename);
18$params = array('file' => $file);
19var_dump(curl_setopt($ch, CURLOPT_POSTFIELDS, $params));
20
21var_dump(curl_exec($ch));
22curl_close($ch);
23?>
24--EXPECTF--
25bool(true)
26string(%d) "АБВ.txt|application/octet-stream|5"
27--CLEAN--
28<?php
29@unlink(__DIR__ . '/АБВ.txt');
30?>
31