Jump to content

Expert Help needed . Display spreadsheet in broswer


sharugan

Recommended Posts

I have a requirement to display the spreadsheet in a browser.I am using the following code that promts for "SAVE" box. I don't to prompt the "SAVE" box.I want to display the spreadsheet in the broswer when the user types the URL.Can any expert help me achieve this.

<?php

 

    $export_file = "worldmap.xls";

    ob_end_clean();

    ini_set('zlib.output_compression','Off');

 

    header('Pragma: public');

    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");                  // Date in the past

    header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');

    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-Type: application/vnd.ms-excel;');                // This should work for IE & Opera

    header("Content-type: application/x-msexcel");                    // This should work for the rest

    header('Content-Disposition: attachment; filename="'.basename($export_file).'"');

 

?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.