M
Matt
Hi,
I have xsn templates stored in db table and I am streaming xsn form as
binary stream to client's browser.
My page http://localhost/GetFile.aspx?FormId=7 code snipsets looks like this
--------------------------------------------------------------------------
while (sqlDataReader.Read())
{
string fileExtension = sqlDataReader["FileExtension"].ToString();
byte[] formFile = (byte[])sqlDataReader["File"];
int fileSize = Int32.Parse(sqlDataReader["FileSize"].ToString());
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = false;
HttpContext.Current.Response.ContentType =
(string)sqlDataReader["FileContentType"];
HttpContext.Current.Response.AddHeader("Content-Length",
fileSize.ToString());
HttpContext.Current.Response.AddHeader("Accept-Ranges", "bytes");
HttpContext.Current.Response.AddHeader("Content-Disposition",
"attachment; filename=\"" +
sqlDataReader["FileName"].ToString() + "." +
sqlDataReader["FileExtension"].ToString() + "\"");
HttpContext.Current.Response.BinaryWrite(formFile);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}
------------------------------------------------------
The problem is that it works for FF - FF starts InfoPath 2007 and display
form.
But in IE7, when IE& starts Infopath 2007, then Infopath display strange
message.
**********************************************************
The form contains XML that cannot be parsed:
An invalid character was found in text content.
Line 1, Position 5
MSCF
************************************************
There is nothing on Position 5, just empty space.
Can somebody give me hint where I am making mistake ?
Thank you.
Matt
I have xsn templates stored in db table and I am streaming xsn form as
binary stream to client's browser.
My page http://localhost/GetFile.aspx?FormId=7 code snipsets looks like this
--------------------------------------------------------------------------
while (sqlDataReader.Read())
{
string fileExtension = sqlDataReader["FileExtension"].ToString();
byte[] formFile = (byte[])sqlDataReader["File"];
int fileSize = Int32.Parse(sqlDataReader["FileSize"].ToString());
HttpContext.Current.Response.Clear();
HttpContext.Current.Response.Buffer = false;
HttpContext.Current.Response.ContentType =
(string)sqlDataReader["FileContentType"];
HttpContext.Current.Response.AddHeader("Content-Length",
fileSize.ToString());
HttpContext.Current.Response.AddHeader("Accept-Ranges", "bytes");
HttpContext.Current.Response.AddHeader("Content-Disposition",
"attachment; filename=\"" +
sqlDataReader["FileName"].ToString() + "." +
sqlDataReader["FileExtension"].ToString() + "\"");
HttpContext.Current.Response.BinaryWrite(formFile);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.End();
}
------------------------------------------------------
The problem is that it works for FF - FF starts InfoPath 2007 and display
form.
But in IE7, when IE& starts Infopath 2007, then Infopath display strange
message.
**********************************************************
The form contains XML that cannot be parsed:
An invalid character was found in text content.
Line 1, Position 5
MSCF
************************************************
There is nothing on Position 5, just empty space.
Can somebody give me hint where I am making mistake ?
Thank you.
Matt