PHP readfile() adding extra bytes to downloaded file

前端 未结 6 1023
难免孤独
难免孤独 2020-12-06 21:49

I am trying to troubleshoot an issue I am having with downloading a \"zip\" file from a php script. It seems that when I download the file using the following code, the dow

6条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-06 22:22

    Sorry for late reply.....

    i don't know i am right until you vote this.....

    edit your code as :

    ob_start(""); 
    //instead of ob_start(); with out a null callback 
    

    and

    ob_end_clean();  //at the end , Note : "important" add instead of ob_end_flush()
    

    ie;

    ob_start("");
    //header           
    ob_end_clean();
    

提交回复
热议问题