File APIs
civicrm_create_file( $params )
Availability: v1.5
This API is used for creating a file
Required Parameter : 'file_type_id'
Parameters:
- 'params' (array) an associative array of name/value property values of civicrm_file.
Returns:
- array of newly created file property values
civicrm_get_file( $params )
Availability: v1.5
This api is used for finding an existing file.
Required parameters : id OR file_type_id of a file
Parameters:
- 'params' (array) an associative array of name/value property values of civicrm_file
Returns:
- Array of all found file property values.
civicrm_update_file( &$params )
Availability: v1.5
This api is used for updating an existing file.
Required parrmeters : id of a file
Parameters:
- 'params' (array) an associative array of name/value property values of civicrm_file
Returns:
- array of updated file property values
civicrm_delete_file( $fileId )
Availability: v1.5
This API is used for deleting a file
Required parameters : id of a file
Parameters:
- 'fileId' (Int) Id of the file to be deleted
Returns:
- null if successfull OR
- object of CRM_Core_Error
 | Deleting a File
Deleting a File will result in deletion of all file_entity assignments for that file. |
Availability: v1.5
Assigns an entity to a file
Parameters:
- 'fileID' (Int) id of a file
- 'entityID' (Int) id of an entity
- 'entity_table' (String)
Returns:
- array of newly created entity-file property values
Availability: v1.5
Returns all files assigned to a single entity instance.
Parameters:
- 'entityID' (Int) id of an entity
- 'entity_table' (String)
Returns:
- nested array of entity-file property values
civicrm_delete_entity_file(&$param)
Availability: v1.5
Deletes an existing entity file assignment.
Required parameters :
1. id of an entity-file
2. entity_id and entity_table of an entity-file
Parameters:
- 'params' (array) an associative array of name/value property values of civicrm_entity_file.
Returns:
- null if successfull OR
- object of CRM_Core_Error