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 5110 to 5129

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 12th December 2024 18:35 Europe/London time based on the source file dated 12th December 2024 10:55 Europe/London time.