Documentation
IPS_SetMediaContent
Require: Symcon >= 3.1
bool IPS_SetMediaContent (int $MediaID, string $Content)
Parameters
| MediaID | ID of the media object whose content is set |
| Content | Base64 coded content |
Returns
If the function succeeds, it returns TRUE, otherwise FALSE.
Description
This function sets the content of the media object with the ID MediaID. It uses the filename that was previously defined by IPS_SetMediaFile.
An error message is returned if the file name is not set or invalid or if the content is not Base64 coded.
This function should be used carefully as it overwrites the content without warning.
Example
$MediaID = IPS_CreateMedia(MEDIATYPE_IMAGE); //Create image
IPS_SetMediaFile($MediaID, "BlackPixel.gif", False);
IPS_SetMediaContent($MediaID, "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=");