File downloading problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Muddasir
    New Member
    • Jun 2007
    • 49

    File downloading problem

    Hello everyone.

    I am facing problem in downloading .xls file.

    I generate report and save data in excel sheet on server. and once user click the 'save data in excel format', an excel sheet is been created on the server.once created then user can download that file.

    i am able to download file but the problem is that when user apply sorting to data and then save data in excel sheet. the file on the server contains the data in the same sorting order as the user selected BUT while downloading file it downloads the old file (i.e without sorting).

    now this is strange because the file on the server got replaced every time user gives command to save the file.

    i guess its cache problem....

    please help me out.

    many thanks
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    You could download on the fly using a spot of content disposition.

    If you already have the php that writes the xls file then change the headers and download it direct to the user.....


    [PHP]header("Content-type: application/msexcel");
    header("Content-Disposition: attachment; filename=excel. xls");[/PHP]

    Comment

    Working...