Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 10, 2012 12:41 PM by solarissf
Apr 09, 2012 01:40 PM|LINK
I used streamreader to read csv and it works locally but when I put it on web host (GoDaddy) it fails with error message below:
Line 38: StreamReader sr = new StreamReader(path+mainDataFile);
I was trying to get my webpage to find users desktop automatically, then grab the file called comma.csv. without uploading anything.
path = Environment.GetFolderPath(Environment.SpecialFolder.Desktop);
mainDataFile = @"\comma.csv";
From when I'm reading on the web, internet security does not allow a webpage to allow access locally to a users pc. There has got to be some way to find the file on the users desktop. What do you think?
Apr 10, 2012 08:15 AM|LINK
This is server code and only runs on the server. As you've found out, due to security restrictions, you cannot access the users machine. Getting the users to upload a file is your only option.
Apr 10, 2012 11:49 AM|LINK
I read something about the user downloading something granting access, then the website can access the users local files. Do you know anything about this option?
Apr 10, 2012 12:37 PM|LINK
Sorry no, I don't know anything about that. It would have to be an ActiveX control or Flash component I'd think, but even then I'm not sure how it would break out of the browser sandbox.
Apr 10, 2012 12:41 PM|LINK
thank you, appreciate the help