Hi,
I have an aspx page at the web server that provides PDF documents for smart
client applications.
Here is the code in aspx page that defines content type:
Response.Conten tType = "applicatio n/octet-stream";
Response.Append Header("Content-Disposition", "attachment;fil ename=" +
fileID.ToString () + ".pdf");
I tested the aspx page by using browser and it works just fine.
Now I need to receive that file by using the
System.Net.WebC lient.DownloadF ile. The problem is that DownloadFile method
returns the following exception:
"Unable to read data from the transport connection: The connection was
closed."
I tested the DownloadFile method to open a direct pdf file like the
following statement:
(new
System.Net.WebC lient()).Downlo adFile(http://localhost/test.pdf,"c:\\t est.pdf");
It works just fine.
How can I use System.Net.WebC lient. DownloadFile to download http
attachments?
Any help would be apprecited,
Alan
I have an aspx page at the web server that provides PDF documents for smart
client applications.
Here is the code in aspx page that defines content type:
Response.Conten tType = "applicatio n/octet-stream";
Response.Append Header("Content-Disposition", "attachment;fil ename=" +
fileID.ToString () + ".pdf");
I tested the aspx page by using browser and it works just fine.
Now I need to receive that file by using the
System.Net.WebC lient.DownloadF ile. The problem is that DownloadFile method
returns the following exception:
"Unable to read data from the transport connection: The connection was
closed."
I tested the DownloadFile method to open a direct pdf file like the
following statement:
(new
System.Net.WebC lient()).Downlo adFile(http://localhost/test.pdf,"c:\\t est.pdf");
It works just fine.
How can I use System.Net.WebC lient. DownloadFile to download http
attachments?
Any help would be apprecited,
Alan
Comment