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?
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?