There have been many things recently and I have never written anything.
Write a stream to the client a few days ago Code :
Filestream myfilestream;
Long Filesize;
Myfilestream = New Filestream = ( " C: \ a.doc " , Filemode. Open );
Filesize = Myfilestream. length;
Byte [] Buffer = New Byte [( Int ) Filesize];
Myfilestream. Read (buffer, 0 ,( Int ) Filesize );
Myfilestream. Close ();
Response. addheader ( " Content-Disposition " , " Attachment; filename = " C: \ a.doc " );
Response. contenttype = " Application/octet-stream " ;
Response. binarywrite (buffer );
Run. The IE dialog box opens and downloads the file. However, if you choose to open the file directly, the Word file is not used.
I tried it several times and thought it was a 2003 security issue.
Later I thought of ASP. NET cache, so I added two lines of code.
Response. Flush ();
Response. Close ();
The result is OK.