C
Cosimo Galasso
I'm building a aspx web page with a button control.
When the button is clicked the server build an xml string containg the
directive to be opened with infopath.
When the client receive the file an error occured.
The strange is that if a save the file locally, open with notepad and save
it again without any modification, the file is correctlu opened with infopath.
Any suggestion?
Here is the code ...
private void Button1_Click(object sender, System.EventArgs e)
{
Response.AddHeader("Content-Disposition", "attachment;filename=Form1.xml");
//Response.AddHeader("Content-Transfer-Encoding", "binary");
Response.ContentType = "application/ms-infopath.xml; charset=utf-16";
Response.BinaryWrite(StringToUTF16ByteArray(outString));
Response.End();
Response.Flush();
Response.Close();
}
here is the first line of the file ...
<?xml version="1.0" encoding="UTF-16"?>
<?mso-infoPathSolution solutionVersion="1.0.0.31" productVersion="11.0.6565"
PIVersion="1.0.0.0"
href="file:///C:\Progetti\INPS\Sources\Inps.Informa.Redazione\Inps.Informa.Redazione.Form\bin\Debug\Inps.Informa.Redazione.Form.xsn"
name="urn:schemas-microsoft-comffice:infopath:Inps_002E_Informa_002E_Redazione_002E_Form:-myXSD-2005-11-10T10-16-37" language="en-us" ?>
<?mso-application progid="InfoPath.Document"?>
<Root xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://intermedio.data.inpsinforma.product.inps.com"><Documento><Sezioni><Sezione..........
When the button is clicked the server build an xml string containg the
directive to be opened with infopath.
When the client receive the file an error occured.
The strange is that if a save the file locally, open with notepad and save
it again without any modification, the file is correctlu opened with infopath.
Any suggestion?
Here is the code ...
private void Button1_Click(object sender, System.EventArgs e)
{
Response.AddHeader("Content-Disposition", "attachment;filename=Form1.xml");
//Response.AddHeader("Content-Transfer-Encoding", "binary");
Response.ContentType = "application/ms-infopath.xml; charset=utf-16";
Response.BinaryWrite(StringToUTF16ByteArray(outString));
Response.End();
Response.Flush();
Response.Close();
}
here is the first line of the file ...
<?xml version="1.0" encoding="UTF-16"?>
<?mso-infoPathSolution solutionVersion="1.0.0.31" productVersion="11.0.6565"
PIVersion="1.0.0.0"
href="file:///C:\Progetti\INPS\Sources\Inps.Informa.Redazione\Inps.Informa.Redazione.Form\bin\Debug\Inps.Informa.Redazione.Form.xsn"
name="urn:schemas-microsoft-comffice:infopath:Inps_002E_Informa_002E_Redazione_002E_Form:-myXSD-2005-11-10T10-16-37" language="en-us" ?>
<?mso-application progid="InfoPath.Document"?>
<Root xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://intermedio.data.inpsinforma.product.inps.com"><Documento><Sezioni><Sezione..........