I'm developing a web application using MVC which is hosted in web server. Whenever a user accesses the application, it has to fetch the local app data folder from the clients machine.
Is there any possible way to achieve the above mentioned scenario?
I have tried using Environment.Specialfolder, but it is giving the path of web servers local data not the path of client's machine
C# :
string s = Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData);
Server-side code cannot just access files on client's machine. Instead, this functionality should be implemented with client-side scripts.
If you need to let your app persist some data or file on user's machine, and later read that data and send it to the server (or use it on the client), you have plenty of options in the modern browsers:
Fetching an arbitrary file from user's machine is a totally different story, because it has security implications. Here your options are:
<input type="file">on a page and let the user pick a file that will be uploaded to the server.