Skip to main content
1 of 3
Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79

It could be a problem of SPUtility.GetFullUrl not being able to work with layouts URLs (since they are shared between all sites in your farm, and not site specific)

Try if

string fullPath=SPUtility.CombineUrl(SPContext.Current.Site.Url, webUrl)

works better.

Don't really now why you are trying to get a file from the virtual directory layouts though! Check for example here of how to read from this directory: How to read a file from a folder in _Layouts?

If possible, you should consider to deploy the file into a library in SharePoint instead. That way you could do CRUD on it just like any other file in SharePoint

Robert Lindgren
  • 24.5k
  • 12
  • 53
  • 79