$attachment = new Attachments(); if (empty($_GET['aid'])) { flash(); } $attach_id = authcode(rawurldecode($_GET['aid']), "DECODE"); if (empty($attach_id)) { flash(); } require LIB_PATH . "func.download.php"; require LIB_PATH . "js.class.php"; $filename = rawurlencode($attachment->getAttachFileName($attach_id)); $filename = $attachment->file_url; if (!sendFile($filename)) { exit('Error occured when get files.'); } else { JS::Close(); } break; default: break; } } if (empty($_GET['id'])) { $picture_src = URL . "images/watermark.png"; } if (isset($_GET['source'])) { $file_source = trim(rawurldecode($_GET['source'])); $picture_src = URL . $attachment_url . $file_source; } setvar("img_src", $picture_src); render("attachment");