D
Dan the Man
Hi All,
My Infopath users are going to be uploading csv files to my form and I want
to read the csv files and perform operations on them. Unfortunately, the
first line returned appears to be corrupted. Here is the code I have for
taking a File Attachment Node and converting it into a string array in C#:
IXMLDOMNode oFileAttachment = ...;
string[] arrFileContents;
try
{
byte[] byteBinaryData =
System.Convert.FromBase64String(oFileAttachment.text);
string strFileContents =
System.Text.Encoding.ASCII.GetString(byteBinaryData);
// Split the File Contents up into an array of lines
arrFileContents = strFileContents.Split('\n');
}
When I cycle through the contents of my array, the first line output says
"IFA[]" (where [] represents the square ASCII Character) no matter what the
first line is. The problem occurs before the "strFileContents.Split('\n');"
line.
So, has anyone else seen this problem and know how to fix it?
Thanks in advance.
My Infopath users are going to be uploading csv files to my form and I want
to read the csv files and perform operations on them. Unfortunately, the
first line returned appears to be corrupted. Here is the code I have for
taking a File Attachment Node and converting it into a string array in C#:
IXMLDOMNode oFileAttachment = ...;
string[] arrFileContents;
try
{
byte[] byteBinaryData =
System.Convert.FromBase64String(oFileAttachment.text);
string strFileContents =
System.Text.Encoding.ASCII.GetString(byteBinaryData);
// Split the File Contents up into an array of lines
arrFileContents = strFileContents.Split('\n');
}
When I cycle through the contents of my array, the first line output says
"IFA[]" (where [] represents the square ASCII Character) no matter what the
first line is. The problem occurs before the "strFileContents.Split('\n');"
line.
So, has anyone else seen this problem and know how to fix it?
Thanks in advance.