我下载文件时,Google Chrome会显示错误

I am using Google Chrome to open my web page.

When I download a file, I get:

ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_DISPOSITION

After that, I go to see my code, I have a line as below:

header('Content-Disposition: attachment; filename='.$downloadFileName);

Can someone help me so that I can download the file?

Enclose filename in double quotes:

header('Content-Disposition: attachment; filename="'.$downloadFileName.'"');

I don't really know PHP's grammer. Assuming your code's syntax is right, I guess you may try:

header('Content-Disposition: attachment; filename=\"'.$downloadFileName.'\"');

You'll need double quotes around the filename.