473,396 Members | 2,033 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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;filename=" . $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 1638

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

Similar topics

9
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...
13
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...
5
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...
40
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...
5
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...
4
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...
16
by: iwdu15 | last post by:
how can i open a file i saved and place the info into different text boxes?
1
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...
0
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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,...
0
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,...
0
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...
0
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...
0
tracyyun
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...

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.