Does someone have a piece of code to read an XML file as the one I put in attachment of this post ?
I want to import it in a Sharepoint list and I have developped a webpart which creates the list and I'm blocking on the way I can read the file to create the names of columns and get the data of each column. If you want to know what I want to get, read the XML file in Excel.
NB : I sent the file in txt so that you can read it first and notice that there is no malicious code in it.
Thanks, that's more less what I started to do. The problem I have is that the file path which is indicated using an HTML input file textbox is not accepted by Sharepoint Server and it seems that it cannot read the value in it (perhaps for security reasons or maybe because I'm not using the right function).
I use MyHtmlInputFile.value (where MyHtmlInputFile is the name of the input file control) to get the path of the file...I've tried to use the Server.MapPath but the webpart components seem to not recognize this type of method...
Hmm.. Just noticed I neglected to mention the fact I would use the XmlTextReader class (myReader = new XmlTextReader), I'm assuming this is accessible through Asp.
I succeed in getting the value which is in the html input file control but It seems that for security reasons Sharepoint refuses to read the file. Are there solutions to make a local file readable by a server ?
NB : I tried to put my file in a shared folder on my computer and to put read rights for All users, but I've always the same FileIOPermission error.
Of course, C:\Mypath\Myfile.ext" is the path and file ON THE DESTINATION SERVER (I personnaly published the file in a subdirectory of my Inetpub/wwwroot/Mysite)
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.