Programmatic Access of Word documents through Infopath

M

MezzCowles

Hello. I'm fairly new to programming Web Services with InfoPath SP1
so please bear with me.

I'm attempting to allow the user to submit a Microsoft Word document
through the InfoPath attachment control. The form will be submitted to
a webservice, which will then save the attachment as a Word file.

However, when I view the attachment later through word, I am asked to
choose my Text Encoding. Picking the default (Windows) presents the
document as it might be seen through notepad. (Not recognized as a
proper word document)

Here is the code I am using to pull the attachment and save it.

///
Byte[] documentBytes =
Convert.FromBase64String(documentNode.InnerText);
strdocPath = @"C:\SomePathWithTheProperPermissions\test.doc"
FileStream objfilestream = new
FileStream(strdocPath,FileMode.Create,FileAccess.ReadWrite);
objfilestream.Write(documentBytes,0,documentBytes.Length);
objfilestream.Close();
///
Am I doing anything obviously foolish?

A secondary question: How do I get the name of the document as it was
submitted by the user?

Thanks!
-Mezz Cowles (Seattle)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top