PHP Download Script Creates Unreadable ZIP File on Mac

前端 未结 3 596
青春惊慌失措
青春惊慌失措 2021-01-07 13:53

For reference, I have already read and tried the answers in these and several other threads:

Creating and serving zipped files with php

Opening downloaded zi

3条回答
  •  粉色の甜心
    2021-01-07 14:25

    Well, I presume you know that your $fsize variable is not being written to that header because it's enclosed by quotes. You could try something like this:

    header('Cache-Control: public');
    header('Content-Description: File Transfer');
    header('Content-Disposition: attachment; filename=\"".$zipname."\"');
    header('Content-Type: application/zip');
    

提交回复
热议问题