Php file system functions seem to hate unicode paths or filenames. I was
working on generic download script and it works fine for regular ascii(?)
files but when i tried a unicode-named file it failed.

$file1 = c:\blah\I've Sound [Air] 鳥の詩(Lia).mp3
$file2 = c:\blah\bleh.mp3

readfile, fopen, filesize etc... fail on $file1, but succeed on $file2.

consider the following:

$fn = $_POST["filename"];
$enfn = urlencode($_POST["filename"]);
header ("Content-type: octet/stream");
header ("Content-disposition: attachment; filename=".basename($encfn).";");
header ("Content-Length: ".filesize($fn)); //fails
readfile($fn); //fails

is unicode support in filesystem functions non-existant or am i doing
something wrong?
is there a work around?

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to