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

  • Home
  • SEARCH
  • 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 6743129
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:55:28+00:00 2026-05-26T11:55:28+00:00

In my PHP application I use phpexcel to dynamically create MS Excel file. On

  • 0

In my PHP application I use phpexcel to dynamically create MS Excel file.

On some of my PC-s, I have a problem because Windows overwrite extenstion of generated XLS file, and it changes it to XLSX.

Can you help me how can I “force”, that file extenstion be XLS and not XLSX?

header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
header('Content-Disposition: attachment;filename="'. date('Y-m-d') .'.xls"');
header('Cache-Control: max-age=0');
$objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
$objWriter->save('php://output');

I guess that reasion is that some of the browsers have setup that “save file without any questions”, and due to that windows change it’s extenstion.

so, how can I avoid it, and to save file always and only with XLS extension.

  • 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-05-26T11:55:29+00:00Added an answer on May 26, 2026 at 11:55 am

    here is a something,

    http://www.givegoodweb.com/post/30/forcing-a-download-with-apache-and-htaccess

    hope it helps

    <Files *.xls>
      ForceType application/octet-stream
      Header set Content-Disposition attachment
    </Files>
    <Files *.eps>
      ForceType application/octet-stream
      Header set Content-Disposition attachment
    </Files>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a PHP application that makes extensive use of Javascript on the client
I'm writing a web application (PHP) for my friend and have decided to use
I have a php application that doesn't use the mvc model that i would
I have the following use case for debugging a PHP application: The developer does
I have a PHP application that needs to generate some PDF invoices and PDF
I have a PHP application that calls web services APIs to get some objects
I would like to use some kind of BB code for a php application:
I have decided to use ResourceBundles to provide translations for my php application. While
I'm creating a PHP application within Heroku. The problem is Heroku doesn't understand some
Somebody said that when your PHP code and application use global variables then it

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.