diff --git a/draftfile.php b/draftfile.php index baeceaf7af7..ede57069134 100644 --- a/draftfile.php +++ b/draftfile.php @@ -36,6 +36,7 @@ if (isguestuser()) { } $relativepath = get_file_argument(); +$preview = optional_param('preview', null, PARAM_ALPHANUM); // relative path must start with '/' if (!$relativepath) { @@ -84,4 +85,4 @@ if (!$file = $fs->get_file_by_hash(sha1($fullpath)) or $file->get_filename() == // finally send the file // ======================================== session_get_instance()->write_close(); // unlock session during fileserving -send_stored_file($file, 0, false, true); // force download - security first! +send_stored_file($file, 0, false, true, array('preview' => $preview)); // force download - security first!