Bug #78520 [Opn->Nab]: php download file name ≈ä½  好;123.zip

From: Date: Tue, 10 Sep 2019 05:40:52 +0000
Subject: Bug #78520 [Opn->Nab]: php download file name ≈ä½  好;123.zip
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-222676@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=78520&edit=1 ID: 78520 Updated by: requinix@php.net Reported by: 77738609 at qq dot com Summary: php download file name ≈ä½  好;123.zip -Status: Open +Status: Not a bug Type: Bug -Package: *URL Functions +Package: *General Issues PHP Version: 7.4.0RC1 Block user comment: N Private report: N New Comment: If $filename has semicolons then it needs to be quoted in the Content-Disposition, and it's using the wrong encoding. Previous Comments: ------------------------------------------------------------------------ [2019-09-10 03:26:24] 77738609 at qq dot com Actual result:&ap Expected result: '≈ä½  好;123.zip'; ------------------------------------------------------------------------ [2019-09-10 03:14:00] 77738609 at qq dot com Description: ------------ php download file name '≈ä½  好;123.zip'; file name is &ap c# can download Test script: --------------- php download file name '≈ä½  好;123.zip'; $filename = iconv('utf-8',"gbk//IGNORE",$filename); $filepath = 'D:/www/'.$filename; $file=fopen($filepath,"r"); header("Content-type:text/html;charset=utf-8"); header("Content-Type: application/octet-stream"); header("Accept-Ranges: bytes"); header("Accept-Length: ".filesize($filepath)); header("Content-Disposition: attachment; filename= $filename ; filename*=utf-8''$filename "); echo fread($file,filesize($filepath)); fclose($file); Expected result: ---------------- php download file name '≈ä½  好;123.zip'; Actual result: -------------- php download file name '≈ä½  好;123.zip'; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=78520&edit=1

« previous php.bugs (#222676) next »