Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9304383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T23:41:45+00:00 2026-06-18T23:41:45+00:00

I’ve got an upload page for users to upload excel files, this is part

  • 0

I’ve got an upload page for users to upload excel files, this is part of a task request type thing. I am trying to have it so when the task is submitted, you can click a link that will then display an html table of the excel file they uploaded. PHP-excel-reader would work perfectly, but it doesn’t support xlsx files. I’m looking at PHPExcel, but can’t quite understand how I take those outputs and make an html table out of them. I’m also worried I can’t get ZipArchive supported in PHP.

Does anyone know of an example where they’ve converted the PHPExcel example to an html table?

EDIT:

The following code is working great. It’s creating a new file when the script is run. I can’t quite figure out how to rename the file correctly. Currently it’s renaming the actual phpexcel.php file containing the code below to phpexcel.htm. I would like to take the name of the $inputFileName and rename that to exceluploads/Book7.htm for example. I wasn’t sure if it ws as simple as changing the $objWriter->save(path/name.htm); but that did not work, I received:

Warning: fopen(/exceluploads/Book7.htm) [function.fopen]: failed to open stream: No such file or directory in /var/www/Classes/PHPExcel/Writer/HTML.php on line 164

Fatal error: Uncaught exception 'Exception' with message 'Could not open file /exceluploads/Book7.htm for writing.'

Code:

    <?php

    /** Error reporting */
    error_reporting(E_ALL);

    /** Include PHPExcel */
    require_once dirname(__FILE__) . '/Classes/PHPExcel.php';


    // Create new PHPExcel object
    echo date('H:i:s') , " Create new PHPExcel object" , PHP_EOL;
    $objPHPExcel = new PHPExcel();

    $inputFileName = 'exceluploads/Book7.xlsx';
    $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);

    echo date('H:i:s') , " Write to HTML format" , EOL;
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
    $objWriter->setSheetIndex(0);
    //$objWriter->setImagesRoot('http://www.example.com');
    $objWriter->save(str_replace('.php', '.htm', __FILE__));

    echo date('H:i:s') , " File written to " , str_replace('.php', '.htm', pathinfo(__FILE__, PATHINFO_BASENAME)) , EOL;


    // Echo memory peak usage
    echo date('H:i:s') , " Peak memory usage: " , (memory_get_peak_usage(true) / 1024 / 1024) , " MB" , EOL;

    // Echo done
    echo date('H:i:s') , " Done writing file" , EOL;
    echo 'File has been created in ' , getcwd() , EOL;

    ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T23:41:46+00:00Added an answer on June 18, 2026 at 11:41 pm

    To read a file:

    $inputFileName = 'example.xls';
    $objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
    

    To write a file:

    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'HTML');
    $objWriter->save('example.html');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I have a view passing on information from a database: def serve_article(request, id): served_article
I have thousands of HTML files to process using Groovy/Java and I need to
I have a bunch of posts stored in text files formatted in yaml/textile (from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.