{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\
{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}byte[]{td}{td}[#bytes]
A byte array holding the content of the Media object.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#mimeType]
The MIME type of the Media object.{td}{tr}{tbody}{table}\\
{table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#getName]\()
The name of the Media object.{td}{tr}{tbody}{tbody}{tr}{td}[UUID]{td}{td}[#getUUID]\()
Returns the UUID of this media{td}{tr}{tbody}{table}\\
{table:id=property|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=bytes|class=node}{tr:id=name}{td}h6.bytes{td}{tr}{tr:id=des}{td}{sub-section:bytes_des|text=|trigger=button}{sub-section}{sub-section:bytes_des|trigger=none|class=sIndent}
Cache
index
true
refresh
100d
showRefresh
true
id
doc
title
Refresh page
showDate
true
retry
Enable
servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClientservoy sSummary12%30%58%height: 30px;3Property SummaryA byte array holding the content of the Media object.The MIME type of the Media object.servoy sSummary12%30%58%height: 30px;3Methods SummaryReturns this media's bytes a a String converting it with the UTF-8 Charset.The name of the Media object.Returns the UUID of this mediavoidSets the bytes of this media to the give String that is converted to bytes using the UTF-8 Charset.propertyservoy sDetail2100%height:30px2Property Detailsbytesname
bytes
dessIndent
A byte array holding the content of the Media object.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:bytes_snc|text=|trigger=button}{sub-section}{sub-section:bytes_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:bytes_prs|text=|trigger=button}{sub-section}{sub-section:bytes_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:bytes_ret|text=|trigger=button}{sub-section}{sub-section:bytes_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:bytes_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:bytes_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:bytes_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:bytes_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:bytes_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:bytes_sam|trigger=none}{code:language=javascript}
var ballBytes = plugins.file.readFile('d:/ball.jpg');
var mapBytes = plugins.file.readFile('d:/map.png');
var ballImage = solutionModel.newMedia('ball.jpg', ballBytes);
application.output('original image name: ' + ballImage.getName());
ballImage.bytes = mapBytes;
ballImage.mimeType = 'image/png';
application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed.
application.output('image mime type: ' + ballImage.mimeType);
application.output('image size: ' + ballImage.bytes.length);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=mimeType|class=node}{tr:id=name}{td}h6.mimeType{td}{tr}{tr:id=des}{td}{sub-section:mimeType_des|text=|trigger=button}{sub-section}{sub-section:mimeType_des|trigger=none|class=sIndent}ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowmimeTypename
mimeType
dessIndent
The MIME type of the Media object.
Some examples are: 'image/jpg', 'image/png', etc.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:mimeType_snc|text=|trigger=button}{sub-section}{sub-section:mimeType_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:mimeType_prs|text=|trigger=button}{sub-section}{sub-section:mimeType_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:mimeType_ret|text=|trigger=button}{sub-section}{sub-section:mimeType_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:mimeType_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:mimeType_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:mimeType_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:mimeType_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:mimeType_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:mimeType_sam|trigger=none}{code:language=javascript}
var ballBytes = plugins.file.readFile('d:/ball.jpg');
var mapBytes = plugins.file.readFile('d:/map.png');
var ballImage = solutionModel.newMedia('ball.jpg', ballBytes);
application.output('original image name: ' + ballImage.getName());
ballImage.bytes = mapBytes;
ballImage.mimeType = 'image/png';
application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed.
application.output('image mime type: ' + ballImage.mimeType);
application.output('image size: ' + ballImage.bytes.length);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\
{table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getName|class=node}{tr:id=name}{td}h6.getName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getName_des|text=|trigger=button}{sub-section}{sub-section:getName_des|trigger=none|class=sIndent}ret
Returns this media's bytes a a String converting it with the UTF-8 Charset.
Returns null if it couldn't convert it or the bytes where null.
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetNamename
getName()
dessIndent
The name of the Media object.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getName_snc|text=|trigger=button}{sub-section}{sub-section:getName_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getName_prs|text=|trigger=button}{sub-section}{sub-section:getName_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getName_ret|text=|trigger=button}{sub-section}{sub-section:getName_ret|trigger=none|class=sIndent}[String] -- A String holding the name of this Media object.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getName_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getName_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getName_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getName_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getName_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getName_sam|trigger=none}{code:language=javascript}
var ballBytes = plugins.file.readFile('d:/ball.jpg');
var mapBytes = plugins.file.readFile('d:/map.png');
var ballImage = solutionModel.newMedia('ball.jpg', ballBytes);
application.output('original image name: ' + ballImage.getName());
ballImage.bytes = mapBytes;
ballImage.mimeType = 'image/png';
application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed.
application.output('image mime type: ' + ballImage.mimeType);
application.output('image size: ' + ballImage.bytes.length);
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUUID|class=node}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[UUID]{span}{span:id=iets|style=float: left; font-weight: bold;}getUUID{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getUUID_des|text=|trigger=button}{sub-section}{sub-section:getUUID_des|trigger=none|class=sIndent}Returns the UUID of this media{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getUUID_snc|text=|trigger=button}{sub-section}{sub-section:getUUID_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getUUID_prs|text=|trigger=button}{sub-section}{sub-section:getUUID_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getUUID_ret|text=|trigger=button}{sub-section}{sub-section:getUUID_ret|trigger=none|class=sIndent}[UUID]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getUUID_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUUID_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getUUID_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUUID_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getUUID_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getUUID_sam|trigger=none}{code:language=javascript}
var ballImg = plugins.file.readFile('d:/ball.jpg');
application.output(ballImg.getUUID().toString());
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}ret
Returns
sIndent A String holding the name of this Media object.clients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowgetUUIDname
getUUID()
dessIndent
Returns the UUID of this media
ret
Returns
sIndentclients
Supported Clients
sIndentSmartClient,WebClient,NGClientsam
Sample
sIdentjavascriptlastDetailRowsetAsStringname
setAsString(string)
dessIndent
Sets the bytes of this media to the give String that is converted to bytes using the UTF-8 Charset.