PHP Outputting File Attachments with Headers

后端 未结 2 1687
不知归路
不知归路 2020-12-18 08:00

After reading a few posts here I formulated this function which is sort of a mishmash of a bunch of others:

function outputFile( $filePath, $fileName, $mimeT         


        
2条回答
  •  遥遥无期
    2020-12-18 08:21

    Not sure if this is the real answer, but I think you intended

    header('Content-Type: ' . $mimeType);
    

    to be

    header('Content-Type: ' . $mimeTypes[$mimeType]);
    

提交回复
热议问题