This project has moved. For the latest updates, please go here.

Save file dialog box

Nov 1, 2012 at 3:31 AM

How can i show the save file dialog box by using ColsedXML?

Coordinator
Nov 1, 2012 at 3:46 AM
Edited Nov 1, 2012 at 3:47 AM

Check this...

Nov 1, 2012 at 4:26 AM

any references for asp.net?

Coordinator
Nov 1, 2012 at 5:45 AM

What do you mean?

Nov 1, 2012 at 6:12 AM

sorry for incomplete question. Actually, i don't want to save the XLWorkbook by using HttpResponse. The following is the example.

///////////////////////////////////////////////////////////////////////////////
XLWorkbook WorkBook  = new XLWorkbook();
//
//Adding the worksheet here
//
HttpResponse response = Response;
response.Clear();
response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
response.AddHeader("content-disposition", "attachment;filename=" + filename + "." + extension);
using (MemoryStream stream = new MemoryStream())
{
workbook.SaveAs(stream);
stream.WriteTo(response.OutputStream);
stream.Close();

}
response.End();
///////////////////////////////////////////////////////////////////////////////

I want the path by using the save file dialog in the web applicaton. 
To use like that.

string filename = @"C:\HelloWorld.xls"; //Get from save file dialog.
WorkBook.SaveAs(filename);

Coordinator
Nov 1, 2012 at 3:23 PM

You can't reach your client's hard drive from your webpage. You can only send the file to the browser for the user to do something with it. Imagine if any page could create files on your hard drive.

Nov 2, 2012 at 12:33 AM

Thank you for your reply.

Yes. Can't create the any file in the client's hard drive from web page.
So must be use the HttpResponse to export the file.
I already tested it.