开发者

Error while reading file

When I reading file like this

var fciNewFileFromComputer = new SP.FileCreationInformation();

fciNewFileFromComputer.Content = System.IO.File.ReadAllBytes("C:\\Documents and Settings\\User1020\\Desktop\\asd.txt");

I am able to read file but when I tried like this

fciNewFileFromComputer.Content开发者_开发问答 = System.IO.File.ReadAllBytes("u4vmebirsdev01//ReportsEBISSRS//ActiveDirectoryTest.rdl"); 

I am getting error

Url formats are not supported

I am clueless, what to do?


You cannot use this method to read file contents from a webserver (via some url)

If the file is local it will work. If it is on a network share then you should use this:

fciNewFileFromComputer.Content = System.IO.File.ReadAllBytes(@"\\u4vmebirsdev01\ReportsEBISSRS\ActiveDirectoryTest.rdl"); 

The @ in front of the string ensures that the \ is not seen as an escape character.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜