A
A.M-SG
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.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition",
"attachment;filename=test.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.WebClient.DownloadFile. 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.WebClient()).DownloadFile(http://localhost/test.pdf,"c:\\test.pdf");
It works just fine.
How can I use System.Net.WebClient. 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.ContentType = "application/octet-stream";
Response.AppendHeader("Content-Disposition",
"attachment;filename=test.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.WebClient.DownloadFile. 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.WebClient()).DownloadFile(http://localhost/test.pdf,"c:\\test.pdf");
It works just fine.
How can I use System.Net.WebClient. DownloadFile to download http
attachments?
Any help would be apprecited,
Alan