Hi,
I thing you must have to create a sub folder in your project solution
to copy first the file to upload then open it rather than directly opening such file at local users computer that is why you are encountering such an error maybe cause by some restricted security access rights permission that was set by the Network administrator... After all you may have an option to delete such uploaded file after using it in your sub directory dump folder...
See my article if could help...
Upload Excel Spreadsheet File to Server, then Display Record(s) in Gridview
xlsUpload.SaveAs(Server.MapPath("~/XlsUploadFile/" +
xlsUpload.FileName.ToString()));
Note:
The '
XlsUploadFile' folder should be existing in your project solution.
This sub directory is for dumping of uploaded file for saving, and also be sure that the
excel file
headers matches the gridview
DataField...
Please see my comments from the vote of 1 by:
Captain Scarlet on my article...
Please remember to vote if could help...