B
Brent
I'm trying to stream files back to the user's browser. Text and JPG
files seem to work fine, but I get nothing -- actually, the missing
photo icon with the red "X" -- when streaming PDF to Internet Explorer
6.x and 7 (beta). I'm hoping for some pointers with this code snippet:
===============================
path = @"c:\pathIsHere\";
filename = "filename.pdf";
Response.ClearContent();
Response.ContentType = "Application/pdf";
long StartPos = 0, FileSize;
FileInfo fi = new FileInfo(path + filename);
FileSize = fi.Length;
Response.AddHeader("Content-Disposition","Filename="+filename);
Response.WriteFile(path + filename, StartPos, FileSize);
Response.End();
===============================
The code works fine in Firefox, and for some other file types in most
browsers. But it kills PDF.
Thanks for any help!
--Brent
files seem to work fine, but I get nothing -- actually, the missing
photo icon with the red "X" -- when streaming PDF to Internet Explorer
6.x and 7 (beta). I'm hoping for some pointers with this code snippet:
===============================
path = @"c:\pathIsHere\";
filename = "filename.pdf";
Response.ClearContent();
Response.ContentType = "Application/pdf";
long StartPos = 0, FileSize;
FileInfo fi = new FileInfo(path + filename);
FileSize = fi.Length;
Response.AddHeader("Content-Disposition","Filename="+filename);
Response.WriteFile(path + filename, StartPos, FileSize);
Response.End();
===============================
The code works fine in Firefox, and for some other file types in most
browsers. But it kills PDF.
Thanks for any help!
--Brent