1

I need to extract file (template.xml) from .xsn (InfoPath form template) using C#.

How can I do this? I tried to do it using "DotnetZip" and "Microsoft System.IO.Compression.DeflateSteam" but it doesn't work.

Any help please?

Thanks in advance!

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179
fofi
  • 11
  • 1
  • 2
  • You're going to need to explain a little more what "it doesn't work" actually means before anybody can offer you any kind of insight into how to fix the issue. Without knowing what's going wrong it's going to be almost impossible. Post some code and give us an idea of which bit isn't working – Dave May 13 '11 at 15:53
  • I've posted a solution [here][1] which doesn't require external libraries. [1]: http://stackoverflow.com/questions/8533105/minimum-c-sharp-code-to-extract-from-cab-archives-or-infopath-xsn-files-in-mem – Matthew Millman Dec 16 '11 at 11:04
  • you can see this solution that i use it, maybe http://stackoverflow.com/questions/9088172/create-infopath-instance-from-xsn-template – Amir Feb 26 '12 at 18:27
  • you can see [this solution][1] that i use it, maybe useful for you. [1]: http://stackoverflow.com/questions/9088172/create-infopath-instance-from-xsn-template – Amir Feb 26 '12 at 18:32
  • you can use below link: http://stackoverflow.com/questions/9088172/create-infopath-instance-from-xsn-template – Amir Feb 26 '12 at 18:33
  • use can use below solution: http://stackoverflow.com/questions/8533105/minimum-c-sharp-code-to-extract-from-cab-archives-or-infopath-xsn-files-in-mem – Amir Mar 13 '12 at 09:45

1 Answers1

1

XSN is not a Zip file, it is CAB.

Here is a blog article talking about manipulation of XSN in JavaScript - http://blogs.msdn.com/b/infopath/archive/2004/05/04/126147.aspx and another one with some samples I've never used http://social.msdn.microsoft.com/Forums/en/csharpgeneral/thread/58d9cf34-9a43-4d58-96c7-44bff69ca5d4.

I've used "Unpack XSN file using extract.exe utility to the local temporary directory".

(Search for "C# cab extract" http://www.bing.com/search?q=c%23+cab+extract for more code samples)

Alexei Levenkov
  • 98,904
  • 14
  • 127
  • 179