Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:utility:downloadutility

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

scriptlog:lib:utility:downloadutility [2026/09/26 09:09] – admin adminscriptlog:lib:utility:downloadutility [2026/09/26 09:16] (current) – admin admin
Line 12: Line 12:
 ======= Docblock Metadata ======= ======= Docblock Metadata =======
  
-  ^ Tag ^ Value ^ +^ Tag ^ Value ^ 
-  | ''@category'' | Utility Class | +| ''@category'' | Utility Class | 
-  | ''@author'' | M.Noermoehammad | +| ''@author'' | M.Noermoehammad | 
-  | ''@license'' | MIT | +| ''@license'' | MIT | 
-  | ''@version'' | 1.0 | +| ''@version'' | 1.0 | 
-  | ''@since'' | Since Release 1.0 |+| ''@since'' | Since Release 1.0 |
  
 ======= Inheritance ======= ======= Inheritance =======
Line 25: Line 25:
 ======= Constants (2) ======= ======= Constants (2) =======
  
-  ^ Visibility ^ Name ^ Value ^ Line ^ +^ Visibility ^ Name ^ Value ^ Line ^ 
-  | ''-'' | ''CHUNK_SIZE'' | ''8192;'' | 18 | +| ''-'' | ''CHUNK_SIZE'' | ''8192;'' | 18 | 
-  | ''-'' | ''DEFAULT_EXPIRY'' | ''28800;'' | 19 |+| ''-'' | ''DEFAULT_EXPIRY'' | ''28800;'' | 19 |
  
 ======= Properties (0) ======= ======= Properties (0) =======
Line 35: Line 35:
 ======= Methods (9) ======= ======= Methods (9) =======
  
-  ^ Visibility ^ Method ^ Summary ^ Line ^ +^ Visibility ^ Method ^ Summary ^ Line ^ 
-  | public static | ''setDownloadHeaders()'' | Set download headers for file delivery | 29 | +| public static | ''setDownloadHeaders()'' | Set download headers for file delivery | 29 | 
-  | public static | ''validateDownloadRequest()'' | Validate download request by identifier | 45 | +| public static | ''validateDownloadRequest()'' | Validate download request by identifier | 45 | 
-  | public static | ''isHotlinkingAllowed()'' | Check if hotlinking is allowed based on referer | 57 | +| public static | ''isHotlinkingAllowed()'' | Check if hotlinking is allowed based on referer | 57 | 
-  | public static | ''isMimeTypeAllowed()'' | Check if MIME type is allowed based on settings | 77 | +| public static | ''isMimeTypeAllowed()'' | Check if MIME type is allowed based on settings | 77 | 
-  | public static | ''deliverFile()'' | Deliver file to client with streaming | 91 | +| public static | ''deliverFile()'' | Deliver file to client with streaming | 91 | 
-  | public static | ''getMimeType()'' | Get MIME type of a file | 117 | +| public static | ''getMimeType()'' | Get MIME type of a file | 117 | 
-  | public static | ''sanitizeFilePath()'' | Sanitize file path to prevent traversal attacks | 143 | +| public static | ''sanitizeFilePath()'' | Sanitize file path to prevent traversal attacks | 143 | 
-  | public static | ''isExpired()'' | Check if download link has expired | 164 | +| public static | ''isExpired()'' | Check if download link has expired | 164 | 
-  | private static | ''getMimeTypeDictionary()'' | Get basic MIME type dictionary | 174 |+| private static | ''getMimeTypeDictionary()'' | Get basic MIME type dictionary | 174 |
  
  
Line 57: Line 57:
 Set download headers for file delivery Set download headers for file delivery
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$filename'' | ''(untyped)'' | //required// | //none// | +|  ''$filename'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$mimeType'' | ''(untyped)'' | //required// | //none// | +|  ''$mimeType'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$filesize'' | ''(untyped)'' | //required// | //none// |+|  ''$filesize'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 75: Line 75:
 Validate download request by identifier Validate download request by identifier
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$identifier'' | ''(untyped)'' | //required// | //none// |+|  ''$identifier'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — bool **Returns:** ''(none declared)'' — bool
Line 91: Line 91:
 Check if hotlinking is allowed based on referer Check if hotlinking is allowed based on referer
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$referer'' | ''(untyped)'' | //required// | //none// | +|  ''$referer'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$allowedDomains'' | ''(untyped)'' | ''[]'' | //none// |+|  ''$allowedDomains'' |  ''(untyped)'' |  ''[]'' |  //none// |
  
 **Returns:** ''(none declared)'' — bool **Returns:** ''(none declared)'' — bool
Line 108: Line 108:
 Check if MIME type is allowed based on settings Check if MIME type is allowed based on settings
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$mimeType'' | ''(untyped)'' | //required// | //none// |+|  ''$mimeType'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — bool **Returns:** ''(none declared)'' — bool
Line 124: Line 124:
 Deliver file to client with streaming Deliver file to client with streaming
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$filepath'' | ''(untyped)'' | //required// | //none// | +|  ''$filepath'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$filename'' | ''(untyped)'' | //required// | //none// | +|  ''$filename'' |  ''(untyped)'' |  //required// |  //none// | 
-  | ''$mimeType'' | ''(untyped)'' | //required// | //none// |+|  ''$mimeType'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — void **Returns:** ''(none declared)'' — void
Line 142: Line 142:
 Get MIME type of a file Get MIME type of a file
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$filepath'' | ''(untyped)'' | //required// | //none// |+|  ''$filepath'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — string **Returns:** ''(none declared)'' — string
Line 158: Line 158:
 Sanitize file path to prevent traversal attacks Sanitize file path to prevent traversal attacks
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$filename'' | ''(untyped)'' | //required// | //none// |+|  ''$filename'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — string|false **Returns:** ''(none declared)'' — string|false
Line 174: Line 174:
 Check if download link has expired Check if download link has expired
  
-  ^ Parameter ^ Type ^ Default ^ Description ^ +^  Parameter ^  Type ^  Default ^  Description ^ 
-  | ''$beforeExpired'' | ''(untyped)'' | //required// | //none// |+|  ''$beforeExpired'' |  ''(untyped)'' |  //required// |  //none// |
  
 **Returns:** ''(none declared)'' — bool **Returns:** ''(none declared)'' — bool
scriptlog/lib/utility/downloadutility.1790413763.txt.gz · Last modified: by admin