One example I have seen uses C#
http://www.cubido.at/Blog/tabid/176/EntryID/40/Default.aspx
I cannot get this to work.
Any help would be appreciated.
--
kb
--
Thanks
Clay Fox
Qdabra Software
http://www.qdabra.com
InfoPathDev.Com
The Largest InfoPath Forum in the World
http://www.infopathdev.com
Thanks for your reply, the code example link that you gave is for C# and I
do not have Visual Studio .NET, only VS for Apps which runs with InfoPath
2007.
Will the C# encoder class that you have work with VB.net? could I just
reference it & use it?
Not sure how to make this work??
Thanks
--
kb
The translation to VB.NET would look something like the following, where
base64encodedstring is the base64 encoded string for the attachment:
Dim attachmentNodeBytes() As Byte =
Convert.FromBase64String(base64encodedstring)
Dim fnLength As Integer = attachmentNodeBytes(20) * 2
Dim fnBytes() As Byte
ReDim fnBytes(fnLength)
Dim i As Integer
For i = 0 To fnLength
fnBytes(i) = attachmentNodeBytes(24 + i)
Next
Dim charFileName As Char() = UnicodeEncoding.Unicode.GetChars(fnBytes)
Dim fileName As String = New String(charFileName)
fileName = fileName.Substring(0, fileName.Length - 1)
Dim fileContents() As Byte
ReDim fileContents(attachmentNodeBytes.Length - (24 + fnLength))
For i = 0 To fileContents.Length - 2
fileContents(i) = attachmentNodeBytes(24 + fnLength + i)
Next
Dim fs As FileStream = New FileStream("C:\" & fileName, FileMode.Create)
fs.Write(fileContents, 0, fileContents.Length)
fs.Close()
---
S.Y.M. Wong-A-Ton
THANKS VERY MUCH!
--
kb