Why does the next warning appear in Google Chrome when downloading a file from the server? Web server - Apache

Resource interpreted as Document but transferred with MIME type application/vnd.openxmlformats-officedocument.wordprocessingml.document 

PHP:

 $file = "uploads/demo.docx"; //text/html; charset=UTF-8 - С этим заголовком предупреждений нету header ("Content-Type: application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document; charset=UTF-8"); header ("Accept-Ranges: bytes"); header ("Content-Length: ".filesize($file)); header ("Content-Disposition: attachment; filename=demo.docx"); readfile($file); 

Even if we just point the file path via HTML

 <a href="http://server/uploads/demo.docx">Скачать</a> 

then we still get the same warning.

    1 answer 1

    Try this <a href="http://server/uploads/demo.docx" download>Скачать</a>

    This is a chrome specific problem. I still remember the bug was associated with it.

    Yes, this one - the roots comes here. Apparently not yet fixed.