Excel 2010 Access to path is denied temp
- by Chris Anderson
I am using excel data reader to read data from an excel file.
FileStream stream = File.Open(filePath, FileMode.Open, FileAccess.Read);
//1. Reading from a binary Excel file ('97-2003 format; *.xls)
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(stream);
//2. Reading from a OpenXml Excel file (2007 format; *.xlsx)
IExcelDataReader excelReader = ExcelReaderFactory.CreateOpenXmlReader(stream);
http://exceldatareader.codeplex.com/
This reads excel 1997-2003 format and excel 2007 format on my local machine and when we move it to our test server.
However, when moved to production, it works for excel 97-2003 files, but when I try to read 2007 files I receive the following error:
Access to the path 'C:\Documents and Settings\PORTALS03\ASPNET\LOCALS~1\Temp\TMP_Z129388041687919815' is denied.
How is it possible that the 97-2003 excel file can be read but the 2007 files throw access is denied?