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?
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
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.
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