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.
Unfortunately, activation email could not send to your email. Please try again.

Saving Excel file to disk

Thread ID:

Created:

Updated:

Platform:

Replies:

76973 Oct 2,2008 03:34 PM Oct 3,2008 06:52 AM ASP.NET Web Forms (Classic) 1
loading
Tags: XlsIO
Kristopher Lilley
Asked On October 2, 2008 03:34 PM

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?


Geetha M [Syncfusion]
Replied On October 3, 2008 06:52 AM

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


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;