Hi Team,
I want user to give option to browse and upload excel sheet and then load worksheet data into sql server table.
Dev Server its fine, But in Prod.Server I don't have write access on any directory. So, I have to read it directly from the memory stream without saving it. Following code am executing with the help of ExcelData Reader dll, could you please suggest if am on the right track to avoid any write permission issue on web server?
if (FileUploadControl.HasFile)
{
try
{
string fileExt = System.IO.Path.GetExtension(FileUploadControl.FileName);
if (fileExt == ".xls")
{
Stream myStream = FileUploadControl.PostedFile.InputStream;
IExcelDataReader excelReader = ExcelReaderFactory.CreateBinaryReader(myStream);
excelReader.IsFirstRowAsColumnNames = true;
DataSet ds1 = excelReader.AsDataSet();
excelReader.Close();
}