tags:

views:

129

answers:

2

I have a file upload control on a web page. Users will upload the excel files and in my code, first I save the excel file to the disk and then open it with OLEDB connection and do my stuff. My question is: Is there anyway to avoid saving this file to disk?

A: 

No. The file exists probably as a text stream data reader somewhere in the file upload control. To get at it, you would have to hack the control or the HttpHandler that is processing the upload, which would not be fun.

Saving it to a file is the best way. It provides you with a well-defined, standardized interface into the file.

Robert Harvey
A: 

SpreadsheetGear for .NET can open a workbook from a file, System.IO.Stream or byte[], so you can load a workbook without saving it to disk.

You can download a free trial here.

Disclaimer: I own SpreadsheetGear LLC

Joe Erickson