By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,696 Members | 1,462 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,696 IT Pros & Developers. It's quick & easy.

File downloading problem

P: 49
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
Feb 28 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 490
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]
Feb 28 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.