Download an xml infopath form from an web page

G

Guest

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-com:eek:ffice: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..........
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top