partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit 774afce6ae03d66dd59935acb41a0ab8833ad1db
parent ebbea85fe8d9dd5dbdb2d0780e6ce2027ca56509
Author: Felicitus <felicitus@felicitus.org>
Date:   Tue, 21 Jun 2011 08:16:04 +0200

Added fix to process both type names for footprints; put out a 404 error
if the file was not found in the database.
Diffstat:
Mfrontend/file.php | 14++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/frontend/file.php b/frontend/file.php @@ -25,6 +25,7 @@ try { $file = PartAttachment::loadById($id); break; case "FootprintAttachment": + case "PartKeepr.FootprintAttachment": $file = FootprintAttachment::loadById($id); break; default: @@ -43,11 +44,16 @@ if ($file == null) { $file = TempUploadedFile::loadById($_REQUEST["tmpId"]); } } -header("Content-Type: ".$file->getMimeType()); -$fp = fopen($file->getFilename(), "rb"); -fpassthru($fp); -fclose($fp); +if (is_object($file)) { + header("Content-Type: ".$file->getMimeType()); + + $fp = fopen($file->getFilename(), "rb"); + fpassthru($fp); + fclose($fp); +} else { + echo "404 not found"; +} PartKeepr::getEM()->flush(); exit(); \ No newline at end of file