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

add_alternative_file()

Description

Add alternative file

Parameters

ColumnTypeDefaultDescription
$resource integer
$name string
$description string ""
$file_name string ""
$file_extension string ""
$file_size integer 0
$alt_type string ''

Return

integer

Location

include/resource_functions.php lines 5108 to 5127

Definition

 
function add_alternative_file($resource,$name,$description="",$file_name="",$file_extension="",$file_size=0,$alt_type='')
    {
    
debug_function_call("add_alternative_file"func_get_args());

    
$name trim_filename($name);
    
$file_name trim_filename($file_name);

    
ps_query("INSERT INTO resource_alt_files(resource,name,creation_date,description,file_name,file_extension,file_size,alt_type) VALUES (?, ?,now(), ?, ?, ?, ?, ?)",
        [
        
'i'$resource,
        
's'$name,
        
's'$description,
        
's'$file_name,
        
's'$file_extension,
        
'i'$file_size,
        
's'$alt_type
        
]
    );
    return 
sql_insert_id();
    }

This article was last updated 8th December 2024 20:35 Europe/London time based on the source file dated 6th December 2024 14:05 Europe/London time.