This file cannot be found when exporting the PHPExcel file.

Source: Internet
Author: User
This file cannot be found when exporting the PHPExcel file! Environment: freeBSD server, PHP + MySQL problem: an excel export function is provided. there is no problem in both windows and Linux testing environments. the file cannot be found on freeBSD online. This file cannot be found when the PHPcode PHPExcel file is exported!
Environment: freeBSD server, PHP + MySQL
Problem: An excel export function is provided, and there is no problem in both windows and Linux testing environments. freeBSD cannot find this file online.
PHP code
          $file_name = isset($_GET['exam_caption']) && !empty($_GET['exam_caption']) ?   $_GET['exam_caption'] : time().mt_rand(1000, 9999);        $outputFileName = iconv ( 'UTF-8', 'gb2312', $file_name . '.xlsx' );        header ( 'Pragma:public' );        header ( 'Expires:0' );        header ( 'Cache-Control:must-revalidate,post-check=0,pre-check=0' );        header ( 'Content-Type:application/force-download' );        header ( 'Content-Type:application/vnd.ms-excel' );        header ( 'Content-Type:application/octet-stream' );        header ( 'Content-Type:application/download' );        header ( 'Content-Disposition:attachment;filename=' . $outputFileName );        header ( 'Content-Transfer-Encoding:binary' );        $objWriter->save ( 'php://output' );


Tutorial expert !!!!

------ Solution --------------------
Print out Lu Jin to see it! If the relative path does not work, change the absolute path!
------ Solution --------------------
No log. how can I call it?

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.