Cannot read file from Client

  • Thread starter Thread starter Johnny
  • Start date Start date
J

Johnny

Hi all:

I have an ASP.NET form that reads an Excel file and populates a datagrid. If
I load the form in IE on the server, and select a local file, the code works
fine. However if I load the form in IE from a client
(http://server/readexcel.aspx) and try to read a local Excel file, the file
cannot be opened.

I imagine it's some kind of a security problem in sending the Excel data
back to the web server, but I am not sure.

Does anyone know how to fix this?

Thanks for any and all help.
 
Well, here's why.

1st case: Your application and machine are on the same machine, hence the
web application has access to your file.

2nd case: You try to access the file from client machine which is fine but
your web server does not have access to your client machine. In other words,
you need to first upload the file to the webserver and then try to read it.

HTH
Vijay
 
Back
Top