Hi:
That information is in the file header. In the post at http://chrissyblanco.blogspot.com/2006/07/infopath-2007-file-attachment-control.html about halfway down the code, the author pulls the file name from the attachment and converts it from bytes to a string. When I tried using this code (modifying only the location it saves a file to, adding a message box to show me the file name variable, and fixing one issue) the fileName variable included the file extension.
The modification I made was to change this:
// The actual filename starts at position 24 . . .
for (int i = 0; i <>
{
fnBytes[i] = attachmentNodeBytes[24 + i];
}
to this:
// The actual filename starts at position 24 . . .
for (int i = 0; i < fnLength; ++i)
{
fnBytes[i] = attachmentNodeBytes[24 + i];
}
since the for condition was not complete (and, of course, <> is not a valid C# operator).