PHPExcel file storage problems

Source: Internet
Author: User
PHPExcel file storage problems
 GetProperties ()-> setCreator ("Maarten Balliauw"); $ objPHPExcel-> getProperties ()-> setLastModifiedBy ("Maarten Balliauw"); $ objPHPExcel-> getProperties () -> setTitle ("Office 2007 XLSX Test Document"); $ objPHPExcel-> getProperties ()-> setSubject ("Office 2007 XLSX Test Document"); $ objPHPExcel-> getProperties () -> setDescription ("Test document for Office 2007 XLSX, generated using PHP classes. "); $ objPHPExcel-> getPro Perties ()-> setKeywords ("office 2007 openxml php"); $ objPHPExcel-> getProperties ()-> setCategory ("Test result file "); $ objPHPExcel-> setActiveSheetIndex (0); $ objPHPExcel-> getActiveSheet ()-> setCellValue ('A1', 'hello1'); $ objPHPExcel-> getActiveSheet () -> setCellValue ('b1 ', 'world2'); $ objPHPExcel-> getActiveSheet ()-> setCellValue ('C1', 'hello3'); $ objPHPExcel-> getActiveSheet () -> setCellValue ('d1 ', 'world4'); $ objPH PExcel-> getActiveSheet ()-> setTitle ('sheet0'); $ objPHPExcel-> setActiveSheetIndex (0); $ phpexcel = PHPExcel_IOFactory: load ("phonelist.xls "); $ sheet = clone $ phpexcel-> getActiveSheet (); $ objPHPExcel-> addExternalSheet ($ sheet); $ objPHPExcel-> removeSheetByIndex (0); $ objPHPExcel-> getActiveSheet () -> removeRow (3); $ objWriter = PHPExcel_IOFactory: createWriter ($ objPHPExcel, 'excel2007 '); $ objWriter-> save (str_replac E ('. php', '.xlsx', _ FILE _); // _ FILE _ => absolute path of an excel FILE?>

In this code, I run the php command to create a file with a suffix of xlsx. however, if I put this code in a file with html tags and open it in Firefox. it cannot be created. why. the modified file content is roughly as follows:


<Br/> number Management System <br/>






Reply to discussion (solution)

Why use form to wrap code?
SetPut it in front of the php code.

Why use form to wrap code?
SetPut it in front of the php code.


I am worried that I cannot find my post. depressed, I cannot find any posts posted by csdn. The problem is solved. it is a permission issue.
Http://blog.csdn.net/cp3alai/article/details/45665283

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.