boolean IPS_SetMediaFile (int $MediaID, string $FileName, boolean $FileMustExist)
ID of the media object
Filename/path of the file to link to
TRUE, if existence should be checked, otherwise FALSE
If the command succeeds, it returns TRUE, otherwise FALSE.
The command binds the file name FileName to the media object with the ID MedienID. If the parameter FileMustExist is set, IP-Symcon checks if the given file exists. The allocated media file must match the media type of the media object.
The file name needs to be unique. If FileName is already bound to another media object, an error is returned
It is absolutely necessary that these files are stored in the main folder "IP-Symcon" or one of its subfolders. Other directories are not possible due to security reasons.
$ImageFile = "Alarm symbol.png"; // Image file $MediaID = IPS_CreateMedia(1); // create the image in the media pool IPS_SetMediaFile($MediaID, $ImageFile, true); // bind the image in the media pool with image file