Author: NickyG | Posted on: 7/16/2010 8:21:49 AM | Views : 519

Hi, I'm trying to read a file on a remote server from my webpage and am having real problems !
My code is:
filetoread = Server.MapPath("\\servername\share\file.csv")
        filestream = File.OpenText(filetoread)
        readcontents = filestream.ReadToEnd() 
It works fine if I put the file in the local directory and use "filetoread = Server.MapPath("file.csv")", but won't do it over the UNC path.
I'm guessing the problem is security related but can't find any info related to it, do I need to somehow specify a username/password somewhere ?

 
...

Go to the complete details ...