« Back to Product

Documentation

IPS_SetMediaContent

Require: IP-Symcon >= 3.1

 boolean IPS_SetMediaContent (int $MediaID, string $Content) 

Parameters

MediaID

ID of the media object whose content is set

Content

Base64 coded content

Returns

If the command succeeds, it returns TRUE, otherwise FALSE.

Description

This command 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.

Warning

This command should be used carefully as it overwrites the content without warning.

Example

$MediaID = IPS_CreateMedia(1); //Create image
IPS_SetMediaFile($MediaID, "BlackPixel.gif", False);
IPS_SetMediaContent($MediaID, "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs=");
Any questions?