Click here to Skip to main content
15,886,769 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
hello

I have a website located in a server and the user can access the website from his local machine.
The website let the user to upload an excel sheet and then display the data in a gridview. But, when the user upload the excel sheet, the website search about the file from the server not from the local machine and it of course does not find the file.

my Question: How I can let the website search about the file from local machine not from the server?

thank you
Posted
Comments
DamithSL 19-Aug-14 0:33am    
can you explain the issue with your code?

By definition, to allow access to any file on some machine, you need to make this machine acting as a server. It could be almost any kind of server: shared file service always available on Windows, FTP, HTTP, or custom service.

However, it is unrelated to ASP.NET, unless you want to enable ASP.NET on some HTTP server on some local machine, but I think this is against the requirements of your request. For important security reasons, no Web application can access anything on client computer, and even the access to the file system objects on the host running the HTTP server is strictly limited, at least for all non-nonsense servers. Think by yourself: who would want to use the Web if it would allow the Web application to access client computers?

—SA
 
Share this answer
 
This can be achieved if you create a folder with the name "upload" and inside this folder create a folder with the username in the server and place the files uploaded by the user to that folder. Now you can read the file from the local drive on the server and then display the data in the gridview.
 
Share this answer
 
Comments
Member 10510849 23-Aug-14 23:56pm    
Thank you for your reply.. this solved my problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900