We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Saving Excel file to disk

Maybe I'm just missing something, but I haven't been able to find a way to save an Excel file to a folder on the server. using the Workbook.SaveAs method seems to give me the ability to either open the workbook in the browser, or prompt the user to download the file. Those work fine for me.

What I need now is some other way to save the file to a folder on the server without any prompt. I'm planning to compress the file before letting the user download it, so I need an actual file to pass into the zip routine. Is there some way to do that?


1 Reply

GM Geetha M Syncfusion Team October 3, 2008 10:52 AM UTC

Hi Kristopher,

You can save the file in the server as below:

workbook.SaveAs(Server.MapPath("Sample.xls"))

But please make sure that if you save the file in a different folder, then you need set permission in order to access it from the client. You can then compress the files and use Page.Response or another aspx page to stream the output to the client.

Please let me know if you have any questions.

Regards,
Geetha


Loader.
Live Chat Icon For mobile
Up arrow icon