CMS  Version 3.9
download.inc File Reference

Go to the source code of this file.

Variables

 $document_id = checkNumeric($_GET["document_id"])
 
 $document = new Document($document_id)
 
 $library = $document->DocumentLibrary()
 
if(!checkRole($library->allow_access) &&! $library->allowAccess()) if(!checkRole($document->allow_access)) $d = new DocumentDownload()
 
$d document_id = $document_id
 
$d user_id = ($user) ? $user->user_id : 0
 
 $filepath = sanitizePath($library->getLibraryDirectory() . DIRECTORY_SEPARATOR . $document->file)
 
 $mimeType = DocumentHandler::getDocMimeType($document->file)
 
 $overrideDisposition = Settings::getValue("document", "always_display_PDFs_in_browser")
 
 $disposition = ($overrideDisposition && $mimeType == 'application/pdf') ? "inline" : "attachment"
 
if(Fakoli::detectXSendFileSupport()) else
 
 $size = filesize($filepath)
 

Variable Documentation

◆ $d

if (!checkRole( $library->allow_access) &&! $library->allowAccess()) if (!checkRole( $document->allow_access)) $d = new DocumentDownload()

Definition at line 66 of file download.inc.

◆ $disposition

$disposition = ($overrideDisposition && $mimeType == 'application/pdf') ? "inline" : "attachment"

Definition at line 89 of file download.inc.

◆ $document

$document = new Document($document_id)

Definition at line 38 of file download.inc.

◆ $document_id

$document_id = checkNumeric($_GET["document_id"])

Definition at line 36 of file download.inc.

◆ $filepath

$filepath = sanitizePath($library->getLibraryDirectory() . DIRECTORY_SEPARATOR . $document->file)

Definition at line 80 of file download.inc.

◆ $library

$library = $document->DocumentLibrary()

Definition at line 40 of file download.inc.

◆ $mimeType

$mimeType = DocumentHandler::getDocMimeType($document->file)

Definition at line 82 of file download.inc.

◆ $overrideDisposition

$overrideDisposition = Settings::getValue("document", "always_display_PDFs_in_browser")

Definition at line 88 of file download.inc.

◆ $size

$size = filesize($filepath)

Definition at line 105 of file download.inc.

◆ document_id

$d document_id = $document_id

Definition at line 67 of file download.inc.

◆ else

Initial value:
{
$f = fopen($filepath, "r")
$f
Definition: download.inc:46
$filepath
Definition: download.inc:42

Definition at line 101 of file download.inc.

◆ user_id

$d user_id = ($user) ? $user->user_id : 0

Definition at line 68 of file download.inc.