Parse XML file downloaded via asp: FileUpload

I have a scenario where a user uploads an XML file and I would like to add the file to a table in my database. However, the hard part is that I need to parse the file and then add some information to several different tables.

In each example that shows how to get the XML file, use the URI to get the file, but how to get the file directly from the database or, preferably, from the asp: FileUpload control during postback?

+4
source share
2 answers

Take a look at the XmlDocument.Load method :

XmlDocument myDoc = new XmlDocument(); myDoc.Load(fu_MyFile.FileContent); 
+4
source

I did this a while ago with ColdFusion and shouldn't have done it yet with Asp.Net, but the main theme is the same.

  • Save the file in code.
  • Download the file using an Xml trick, XmlDocument like Abe, or XElement.Load (file)
  • Disassemble it as you want.
  • Delete a file.
0
source

All Articles