Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Damaged Files! Help!

Status
Not open for further replies.

Shanksta

Technical User
Joined
Jun 28, 2002
Messages
96
Location
US
I am trying to make a system where we upload files to users in our database and they can then recieve it. There is a problem though:

Problem: Getting an error on display of PDF after download.
Error: "There was an error opening this document. This file is damaged and
cannot be repaired."

Code:
header("Content-type: mime=" . $myrow['mime']);
header("Content-Disposition: attachment; filename=" . $myrow['file']);
echo $myrow['file'];

Observation: I noticed that the download file size has 8 kbytes more than
the original.

The problem may be in the code, any ideas?
 
is there anyway you can display it as a text file so you can see all of the headers, and data to see what the problem is?

___________________________________
[morse]--... ...--[/morse], Eric.
 
What would $myrow['mime'] resolve to ? think it should be application/pdf
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top