importResourceFromContent()
public method
The given content typically is binary data or a text format. On a successful import this method
returns a PersistentResource object representing the imported content and automatically publishes it to the
configured publication target.
The specified filename will be used when presenting the resource to a user. Its file extension is
important because the resource management will derive the IANA Media Type from it.
public importResourceFromContent ( string $content, string $filename, string $collectionName = ResourceManager::DEFAULT_PERSISTENT_COLLECTION_NAME, string $forcedPersistenceObjectIdentifier = null ) : PersistentResource |
$content |
string |
The binary content to import |
$filename |
string |
The filename to use for the newly generated resource |
$collectionName |
string |
Name of the collection this new resource should be added to. By default the standard collection for persistent resources is used. |
$forcedPersistenceObjectIdentifier |
string |
INTERNAL: Force the object identifier for this resource to the given UUID |
return |
PersistentResource |
A resource object representing the imported resource |