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 1 1206
Thus wrote Brent ""b b i g l e r y a h o o . c o m, 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.
Try using TransmitFile() instead of WriteFile().
Cheers,
--
Joerg Jooss ne********@joergjooss.de This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Razvan |
last post by:
Hi !
I have a big problem with my web site www.mihaiu.name.
Sometimes when I visit my page with IE6 the browser ask me to download
the index.html file ! The options are open, save, cancel,...
|
by: Cliff R. |
last post by:
Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working. A few browsers are...
|
by: David Blickstein |
last post by:
I have some XML documents that I want to open in a web browser and be
automatically translated to HTML via XSLT. I'm using an xml-stylesheet
processing command in a file called "girml.xml".
...
|
by: comp.lang.php |
last post by:
class ReportGenerator {
function ReportGenerator() {}
/**
* Generate the HTTP headers necessary for this file type. Can be
called statically
*
|
by: Giggle Girl |
last post by:
Hi there,
I am having a problem with the behavior of Firefox, where lefthand
column content is not resized properly after it is "collapsed" and then
"re-expanded". An online demo is available...
|
by: minnesotti |
last post by:
Hi there,
I subscribed to a photographic pictures-hosting website which is heavy
on JavaScript. My preferred latest browser Mozilla Firefox does not
work with it -- no pictures are displayed and...
|
by: puja |
last post by:
hi all,
I have an asp.net website where am including .css file dynamically on page
load event. For diff users, there is diff CSS file. So after user logs in, I
am setting CSS href on page load....
|
by: =?Utf-8?B?Sm9obiBCYWlsZXk=?= |
last post by:
I have a ASP .Net page that allows moving around items on the page through
javascript. This page works fine in IE.
In FireFox however, I have found that if the page is using XHTML 1.0...
|
by: SAL |
last post by:
Hello, I did google this issue and found some stuff related to BrowserCaps
section of either web.config or machine.config but it didn't work.
It seems that most pages in my webapp are okay but a...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| | |