Last post Apr 07, 2017 04:13 AM by kaushalparik27
Apr 06, 2017 09:00 PM|Faqundo|LINK
Hello my friends,
I made a bussiness application that works inside an intranet. I always programmed in Windows Forms so, I am having problems with some ASP NET concepts. When the user clicks a button I need to:
1) Read some files in the client PC.
2) Upgrade the database with values read from the files.
I was reading the file with StreamReader from a local path, it worked on development because Client and Server are the same machine. Obviously when working on a real server, it's trying to read the file that it's located on the client machine, from the
server, therefore doesn't find the path.
What is the best way to achieve this?
Is it best to use a share folder or some control to upload the files to the server? The files are TXT (read and update the database) and images that are uploaded to the database as base64.
Apr 07, 2017 04:13 AM|kaushalparik27|LINK
Is it best to use a share folder or some control to upload the files to the server?
As you described, in Client/Server application you will require to upload the files first on server then you will be able to read those files and do further processing. Alternatively, you can actually also use shared path but that will require you to make
sure that ASPNET process (IIS User) has enough rights to access the path to get those files, or you will require to impersonate the process of reading files in your code.