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 3302092
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:48:59+00:00 2026-05-17T20:48:59+00:00

One Way am creating an xls with fopen(test.xls) . Using fwrite i write xls

  • 0

One Way
am creating an xls with fopen(“test.xls”) .

Using fwrite i write xls and readfile give me the file.

Second Way

I generating xls with putting

 header('Cache-Control: no-store, no-cache, must-revalidate');     // HTTP/1.1
    header('Cache-Control: pre-check=0, post-check=0, max-age=0');    // HTTP/1.1
    header ("Pragma: no-cache");
    header("Expires: 0");
    header('Content-Transfer-Encoding: none');
    header("Content-Disposition: attachment; filename=\"test.xls\""); 
    header("Content-Type: application/vnd.ms-excel");

foreach ()

{

echo contents to the file

}

Is there any difference between these 2 ways of generating file.

What is difference.

  • 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-17T20:49:00+00:00Added an answer on May 17, 2026 at 8:49 pm

    Your first approach creates the file inside the server filesystem, then serves it through the browser. The file stays there (unless you have extra code to delete it afterwards).

    Your second approach does not seem to create an actual file inside the filesystem, it generates data on the fly – and the browser then saves it to a file.

    Is that what you were asking?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is a good way of creating non-blocking methods in Scala? One way I
Is there any way creating a photo gallery using Listview control ? Im playing
I have to upload dynamically created data file to web server. One way to
I once read that one way to obtain a unique filename in a shell
So I was thinking one way that you can bring method chaining into PHP
There may be more than one way to ask this question, so here's a
I am looking for a simple unpatented one-way encryption algorithm, preferably in c. I
If there is more than one way, please list them. I only know of
We have an app that uses simple one way binding with a GridView to
I work on a app which has only one way to get a working

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.