Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

get_extension()

Description

Get resource file extension from the database or use JPG, for download

Parameters

ColumnTypeDefaultDescription
$resource array
$size string Preview size as defined in the system

Return

string

Location

include/resource_functions.php lines 7396 to 7414

Definition

 
function get_extension(array $resource$size)
    {
    global 
$job_ext;
    if(
$size == '')
        {
        
$size 'original';
        }

    
// Offline collection download job may have requested a specific file extension
    
$pextension $size == 'original' $resource['file_extension'] : ((isset($job_ext) && trim($job_ext) != "") ? $job_ext 'jpg');

    
$replace_extension hook('replacedownloadextension''', array($resource$pextension));
    if(
trim($replace_extension) !== '')
        {
        return 
$replace_extension;
        }

    return 
$pextension;
    }

This article was last updated 15th December 2024 18:35 Europe/London time based on the source file dated 13th December 2024 14:45 Europe/London time.