# Management of Media > Symcon documentation · English · generated on 2026-09-26 > Index: https://www.symcon.de/en/llms.txt Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ ## IPS_CreateMedia Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-createmedia/ `int IPS_CreateMedia(int $MediaType)` creates a new media object in the media pool **Parameters** - `$MediaType` (int) | Value | Description | | ----- | --------------------------- | | 0 | creates an __IPSView Form__ | | 1 | creates an __Image Object__ | | 2 | creates a __Sound Object__ | | 3 | creates a __Stream Object__ | | 4 | creates a __Chart Object__ | | 5 | creates a __Document Object__ | **Returns** (int): ID of the newly created media object | Value | Description | | ----- | --------------------------- | | 0 | creates an __IPSView Form__ | | 1 | creates an __Image Object__ | | 2 | creates a __Sound Object__ | | 3 | creates a __Stream Object__ | | 4 | creates a __Chart Object__ | | 5 | creates a __Document Object__ | **Example** ```php $ImageFile = "C:\\Pictures\\Alarm_symbol.png"; // Image file $MediaID = IPS_CreateMedia(1); // create the image in the media pool IPS_SetMediaFile($MediaID, $ImageFile); // connect the image in the media pool with image file IPS_SetName($MediaID, "Alarm"); // Name media object IPS_SetParent($MediaID, 12345); // Sort object to its parent ``` ## IPS_DeleteMedia Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-deletemedia/ `bool IPS_DeleteMedia(int $MediaID, bool $DeleteFile)` removes a media object from the media pool **Parameters** - `$MediaID` (int): ID of the media object to be deleted - `$DeleteFile` (bool): __TRUE__ if the file should be deleted, __FALSE__ if the file should be moved to the 'deleted' folder. **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. __TRUE__ if the file should be deleted, __FALSE__ if the file should be moved to the 'deleted' folder. **Example** ```php IPS_DeleteMedia($MediaID, true); ``` ## IPS_GetMedia Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-getmedia/ `array IPS_GetMedia(int $MediaID)` returns extensive information about a specific media object **Parameters** - `$MediaID` (int): The ID of the media object **Returns** (array): The following information are available as key => value pairs: | Index |  Type | Description | | ------------------------------- | ------- | -------------------------------------------------------------------------------- | | __IsAvailable__(up to 3.4) | boolean | TRUE if media file is available (replaced by MediaIsAvailable since version 4.0) | | __IsLinked__(up to 3.4) | boolean | TRUE if the file is located outside the Media folder (removed since version 4.0) | | __LastUpdate__(up to 3.4) | float | Unix timestamp of last update (replaced by MediaUpdated since version 4.0) | | __MediaCRC__ | string | CRC32 of the file | | __MediaFile__ | string | Path to the file | | __MediaID__ | integer | MediaID | | __MediaIsAvailable__(since 4.0) | boolean | TRUE if media file is available | | __MediaSize__ | integer | Size in bytes | | __MediaType__ | integer | Media Type (0: Form 1: Image 2: Sound 3: Stream 4: Chart, 5: Document) | | __MediaUpdated__(since 4.0) | integer | Unix timestamp of last update | | __SendEvent__(up to 3.4) | boolean | TRUE if automatic file changes should be sent (removed since version 4.0) | The ID of the media object **Example** ```php // Since Version 4.0 print_r(IPS_GetMedia(45699)); /* returns e.g.: Array ( [MediaCRC] => E2D2C1D1 [MediaFile] => media\45699.bin [MediaID] => 45699 [MediaIsAvailable] => 1 [MediaIsCached] => [MediaSize] => 8192 [MediaType] => 0 [MediaUpdated] => 1214421546 ) */ print_r(IPS_GetMediaCompatibility(45699)); /* returns e.g.: Array ( [IsAvailable] => 1 [IsLinked] => [LastUpdate] => 1214421546 [MediaCRC] => E2D2C1D1 [MediaFile] => media\45699.bin [MediaID] => 45699 [MediaSize] => 8192 [MediaType] => 0 [SendEvent] => ) */ // Up to Version 3.4 print_r(IPS_GetMedia(45699)); /* returns e.g.: Array ( [IsAvailable] => 1 [IsLinked] => [LastUpdate] => 1214421546 [MediaCRC] => E2D2C1D1 [MediaFile] => media\45699.bin [MediaID] => 45699 [MediaSize] => 8192 [MediaType] => 0 [SendEvent] => ) */ ``` ## IPS_GetMediaContent Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-getmediacontent/ `string IPS_GetMediaContent(int $MediaID)` _Requires Symcon >= 3.1_ returns the content of a media object **Parameters** - `$MediaID` (int): ID of the media object whose content should be returned **Returns** (string): Returns the content of the media object coded in Base64 ID of the media object whose content should be returned **Example** ```php $Content = base64_decode(IPS_GetMediaContent(12345)); ``` ## IPS_GetMediaID Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-getmediaid/ `int IPS_GetMediaID(string $MediaName)` returns the ID of a media object **Parameters** - `$MediaName` (string): Name of the searched media object **Returns** (int): ID of the searched media object, 0 if no object is found Name of the searched media object **Example** ```php $MediaID = IPS_GetMediaID("Rain"); if ($MediaID == 0) echo "Media object not found!"; else echo "The ID of the media object is ". $MediaID; ``` ## IPS_GetMediaIDByFile Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-getmediaidbyfile/ `int IPS_GetMediaIDByFile(string $MediaPath)` return the ID of a media object by its file **Parameters** - `$MediaPath` (string): Relative media path as seen from main program path **Returns** (int): ID of the searched media object, otherwise 0 Relative media path as seen from main program path **Example** ```php $MediaID = @IPS_GetMediaIDByFile("media\\help.png"); if ($MediaID == 0) echo "Picture not found!"; else echo "The Media ID is: ". $MediaID; ``` ## IPS_GetMediaIDByName Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-getmediaidbyname/ `int IPS_GetMediaIDByName(string $MediaName, int $ParentID)` returns the ID of a media object by its name **Parameters** - `$MediaName` (string): Name of the searched media - `$ParentID` (int): ID of the object whose children are searched for the media object **Returns** (int): ID of the found media object, otherwise FALSE ID of the object whose children are searched for the media object **Example** ```php $MediaID = @IPS_GetMediaIDByName("MyPicture", 12345); if ($MediaID === false) echo "Picture not found!"; else echo "The Media ID is: ". $MediaID; ``` ## IPS_GetMediaList Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-getmedialist/ `array IPS_GetMediaList()` returns a list of all media objects in the media pool **Returns** (array): An array that contains all IDs of the media objects in IP Symcon as integers The command determines the IDs of all registered media objects in the media pool. The IDs are listed in an array. If no media object exists, the array is empty. The objects of all media types are listed. To restrict the array by a media type, the command [IPS_GetMediaListByType](management-media.md) can be used. **Example** ```php $allMediaObjects = IPS_GetMediaList(); print_r($allMediaObjects); /* returns e.g.: Array ( [0] => 37659 [1] => 18326 etc. ... */ ``` ## IPS_GetMediaListByType Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-getmedialistbytype/ `array IPS_GetMediaListByType(int $MediaType)` returns a list of all media objects of a specific type **Parameters** - `$MediaType` (int) | Value | Description | | ----- | --------------- | | 0 | IPSView Form | | 1 | Image object | | 2 | Sound object | | 3 | Stream object | | 4 | Chart object | | 5 | Document object | **Returns** (array): An array of integer values ​​of all IDs of the media objects with the type __MediaType__ in IP Symcon. | Value | Description | | ----- | --------------- | | 0 | IPSView Form | | 1 | Image object | | 2 | Sound object | | 3 | Stream object | | 4 | Chart object | | 5 | Document object | **Example** ```php $allImageObjects = IPS_GetMediaListByType(1); // list only Image objects print_r($allImageObjects); /* returns e.g.: Array ( [0] => 37659 [1] => 18326 etc. ... ) */ ``` ## IPS_MediaExists Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-mediaexists/ `bool IPS_MediaExists(int $MediaID)` checks if a specific media object is contained within the media pool already **Parameters** - `$MediaID` (int): ID of the media object **Returns** (bool): If the MediaID exists in the system, __TRUE__ is returned, otherwise __FALSE__. ID of the media object **Example** ```php if (IPS_MediaExists(34881)) echo "A media object with this ID exists!"; ``` ## IPS_SendMediaEvent Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-sendmediaevent/ `bool IPS_SendMediaEvent(int $MediaID)` send a notification that a media object was changed **Parameters** - `$MediaID` (int): ID of the media object **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. ID of the media object **Example** ```php IPS_SendMediaEvent(12345); ``` ## IPS_SetMediaCached Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-setmediacached/ `bool IPS_SetMediaCached(int $MediaID, bool $CacheActivated)` activates that a media object is only modified in the internal memory **Parameters** - `$MediaID` (int): ID of the media object - `$CacheActivated` (bool): __TRUE__, if the media object should only be modified in the cache, otherwise __FALSE__ **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. __TRUE__, if the media object should only be modified in the cache, otherwise __FALSE__ **Example** ```php $MediaID = IPS_CreateMedia(1); // Create image within the media pool IPS_SetMediaCached($MediaID, true); // Caching is activated for the media object // The object is read from the physical memory on the first access // Future accesses are done in the internal memory only. ``` ## IPS_SetMediaContent Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-setmediacontent/ `bool IPS_SetMediaContent(int $MediaID, string $Content)` _Requires Symcon >= 3.1_ set the content of a media object **Parameters** - `$MediaID` (int): ID of the media object whose content is set - `$Content` (string): Base64 coded content **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. Base64 coded content **Example** ```php $MediaID = IPS_CreateMedia(1); //Create image IPS_SetMediaFile($MediaID, "BlackPixel.gif", False); IPS_SetMediaContent($MediaID, "R0lGODlhAQABAIAAAAUEBAAAACwAAAAAAQABAAACAkQBADs="); ``` ## IPS_SetMediaFile Source: https://www.symcon.de/en/service/documentation/command-reference/management-media/ips-setmediafile/ `bool IPS_SetMediaFile(int $MediaID, string $FileName, bool $FileMustExist)` bind a media file to a media object **Parameters** - `$MediaID` (int): ID of the media object - `$FileName` (string): Filename/path of the file to link to - `$FileMustExist` (bool): __TRUE__, if existence should be checked, otherwise __FALSE__ **Returns** (bool): If the command succeeds, it returns __TRUE__, otherwise __FALSE__. __TRUE__, if existence should be checked, otherwise __FALSE__ **Example** ```php $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 ```