while downloading filenames from non english languages are not getting displayed on the downloaded f
Posted
by pks83
on Stack Overflow
See other posts from Stack Overflow
or by pks83
Published on 2010-04-05T12:29:02Z
Indexed on
2010/04/05
12:33 UTC
Read the original article
Hit count: 479
filedownload
|php
When i am trying to download a file whose name has characters from languages like chinese japanese etc...... non ascii... the downloaded file name is garbled. How to rectify it.
I have tried to put charset=UTF-8 in the Content-type header property, but no success. Please help. Code below.
header("Cache-Control: ");// leave blank to avoid IE errors
header("Pragma: ");// leave blank to avoid IE errors
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=\"".$instance_name."\"");
header("Content-length:".(string)(filesize($fileString)));
sleep(1);
fpassthru($fdl);
© Stack Overflow or respective owner