-
Notifications
You must be signed in to change notification settings - Fork 3
Features
Existing managed files can be converted while editing the containing node.
Manage fields page of a content type. Showing a new file field using the Convert File widget:
Convert File widget exposes two new configuration elements to the field settings:
Display the current converted file, as well as all backups of previous versions.
Configuration:
Display (this file was uploaded as .txt, auto converted to .odt, then later via inline conversion form to .pdf):
While editing the reaction rule "CF Google Drive convert to PDF"
Code may also provide file conversion by calling the following function convertfile_convert_file()
, though rules still provide the ultimate functionality.
/**
* Programmatic wrapper for convertfile_validate_conversion().
*
* Call this function directly to perform a programmatically based conversion.
* Rules, and even most programmatic functions, expect file conversion to be
* initiated by an upload to a file field that has an instance configuration,
* therefore this configuration must be mocked up if it does not really exist.
*
* @param int|stdClass $file
* The FID or file object to convert. This object may be modified.
* @param string $provider
* The machine name of the provider.
* @param string $format
* The machine name of the format to convert to.
* @param array $specific
* The exact construction of options is dependent on the provider.
*
* @return bool
* TRUE on successful conversion, FALSE otherwise. See watchdog for error
* details.
*/
function convertfile_convert_file($file, $provider, $format, $extensions = NULL, $specific = NULL)
Any failed conversion happening during an upload will fail the entire upload via validation form errors.