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)
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)