473,670 Members | 2,656 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Files don't show on Windows/MSIE

I am attempting to download files (usually images) for viewing with
either the user's browser or a program associated with the file type.
Unfortunately, this requires that it works in MSIE (works ok with
Mozilla and Opera) but when I attempt to use MSIE it offers a choice
of either opening it or saving.

Opening the message, causes the image viewing program to state that
the file is not a valid jpeg (I'm using jpegs for testing presently).
And when I select "Save", nothing is downloaded.

I'm already losing my hair, so please save the hair!

The afflected code:

header("Content-type: " .
$row['mime_type']);
header("Content-length: " . $row['size']);
header("Content-Disposition:
attachment;file name=" . $row['filename']);
header("Pragma: no-cache");
header("Expires : 0");
$fa = fopen("/tmp/attach/" . $row['id'],"rb");
$buffer = fread ($fa, $row['size']);
echo $buffer;

I've also tried:

$fa = fopen("/tmp/attach/" . $row['id'],"rb");
echo fread ($fa, $row['size']);
fpassthru($fa)
or die("Unable to read file!");
Thanx

*************** *************** ******
This is the final test of a gentleman: His respect for
those who can be of no possible service to him.

--William Lyon Phelps, American educator (1865-1943).
*************** *************** *********
--Lee
Design West
Chief Technology Officer
ACM Member
Computer Society Member
Usenix & SAGE

Jul 16 '05 #1
0 1665

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
6603
by: Jim Richardson | last post by:
I am pulling apart some big apache logs (800-1000MB) for some analysis, and stuffing it into a MySQL database. Most of it goes ok, despite my meager coding abilities. But every so often I run across "borken" bits of data, like user agent strings that include "'/\ and such, although they are escaped by apache in writing the log, they break up my somewhat clunky splits. A typical (good) line, looks like this
13
3037
by: | last post by:
Although this question does not belong in here, I hope someone help, as I do not know where to send it, but someone here might have come acros similar problem: Some of JPG files sitting in the same folder show up OK on an HTML page, while the other do not as if they are not there or their name is misspelt. Tried low-upper case in an ASP page, and in the files names - same result Then I noticed that the same files do not show up in the...
5
8024
by: Randall Parker | last post by:
I am trying to take some very MS-specific HMTL and make it work in Mozilla and Opera. I see that there is a character that shows as a right arrow in IE that shows as an R in a circle in Moz and Opera. Here's excerpt that generates the right arrow in IE. <span style='font-size:small;font-family:Symbol;mso-ascii-font-family:"Verdana"; mso-hansi-font-family:"Verdana";mso-char-type:symbol;mso-symbol-font-family: Symbol'><span...
40
3109
by: komone | last post by:
"Now is the time for all good web developers to use stylesheets". Hmm OK, so I start this commercial site design with the express intent of using CSS entirely. (Something I haven't attempted in about 3 years since I last wasted my time trying to get it to work). The site layout is intended to look (nearly precisely) like this from the CSS-2 spec: http://www.w3.org/TR/REC-CSS2/visuren.html#fixed-positioning
5
5197
by: joaopedrogoncalves | last post by:
Hi, I want to load an external javascript file, get its results and stick them inside a <div> block. I also want to do this in several places on a web page. This way the browser doesn't have to wait for the external resource to load to show up the page, thus giving a perceiving faster load time for the user.
4
1710
by: Gregor | last post by:
I am trying to use an image map with a mouseover function to show various DIV tags. I am not an expert, but what I've come up with works in IE but not in FireFox. Any insight would be greatly appreciated. Below is the js and CSS code <SCRIPT TYPE="text/javascript"> <!-- var layerRef="",styleSwitch="",curMenu="";
16
2198
by: iwdu15 | last post by:
how can i open a file i saved and place the info into different text boxes?
1
2937
by: goodweather | last post by:
Hello, I have a strange problem with my new website. I have installed IIS 5.1 (Win XP pro). The website runs pretty well but sometimes the web browser does not display all the images that should be present on a page (the browser displays a red "X" instead). When I request the page again, the missing images are displayed after reloading the page a few times, or after I request these files manually by typing their name in the address window of...
0
8468
marktang
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8386
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8901
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8814
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
5683
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4209
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4390
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2799
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1792
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.