$Web Put Binary: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 2: | Line 2: | ||
<span class="pageSubtitle"><section begin="desc" />$Web_Put_Binary: Add binary string to response buffer<section end="desc" /></span> | <span class="pageSubtitle"><section begin="desc" />$Web_Put_Binary: Add binary string to response buffer<section end="desc" /></span> | ||
$Web_Put_Bin sends a binary string to the client buffer. $Web_Put_BinARY is a synonym for the $Web_Put_Bin function. This synonym is available in ''[[Sirius Mods]]'' Version 6.7 and later. | |||
==Syntax== | ==Syntax== | ||
<p class="syntax"><section begin="syntax" /> %RC = $Web_Put_Bin( bin_string ) | <p class="syntax"><section begin="syntax" /> %RC = $Web_Put_Bin( bin_string ) | ||
<section end="syntax" /></p> | <section end="syntax" /></p> | ||
$Web_Put_Bin is a callable $function (see [[Calling_Sirius_Mods_$functions|Calling Sirius Mods $functions]]). | $Web_Put_Bin is a callable $function (see [[Calling_Sirius_Mods_$functions|Calling Sirius Mods $functions]]). | ||
$Web_Put_Bin takes a single required string argument and returns a status code. | $Web_Put_Bin takes a single required string argument and returns a status code. | ||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
<tr><th>bin_string</th> | <tr><th>bin_string</th> | ||
<td>A "binary" string that is added to the client buffer without any translation. Since the client buffer is always sent to the browser without translation, the binary contents of ''bin_string'' will be received by the browser. | <td>A "binary" string that is added to the client buffer without any translation. Since the client buffer is always sent to the browser without translation, the binary contents of ''bin_string'' will be received by the browser. Under ''[[Sirius Mods]]'' Version 6.7 and later, $Web_Put_Bin is longstring capable: it can send a longstring with a length greater than 255 bytes. | ||
</td></tr></table> | </td></tr> | ||
</table> | |||
<table class="syntaxTable"> | <table class="syntaxTable"> | ||
Line 27: | Line 27: | ||
<tr><th>-4</th> | <tr><th>-4</th> | ||
<td>Missing argument</td></tr> | <td>Missing argument</td></tr> | ||
</table> | </table> | ||
<p class="caption">$Web_Put_Bin return codes</p> | <p class="caption">$Web_Put_Bin return codes</p> | ||
Line 35: | Line 34: | ||
STOP | STOP | ||
</p> | </p> | ||
This sample shows a binary image in .jpg format being sent from a %variable to the client buffer (the image would have to be pretty small, given the 255 byte limitation on %variables). | This sample shows a binary image in .jpg format being sent from a %variable to the client buffer (the image would have to be pretty small, given the 255 byte limitation on %variables). | ||
Note that another way to send binary data is to store it in a ''Model 204'' procedure and send it to the client using $Web_ProcSend. | Note that another way to send binary data is to store it in a ''Model 204'' procedure and send it to the client using [[$Web_ProcSend]]. | ||
[[Category:Janus Web Server $functions|$Web_Put_Bin, $Web_Put_Binary]] | [[Category:Janus Web Server $functions|$Web_Put_Bin, $Web_Put_Binary]] |
Revision as of 21:19, 22 February 2011
<section begin="desc" />$Web_Put_Binary: Add binary string to response buffer<section end="desc" />
$Web_Put_Bin sends a binary string to the client buffer. $Web_Put_BinARY is a synonym for the $Web_Put_Bin function. This synonym is available in Sirius Mods Version 6.7 and later.
Syntax
<section begin="syntax" /> %RC = $Web_Put_Bin( bin_string ) <section end="syntax" />
$Web_Put_Bin is a callable $function (see Calling Sirius Mods $functions).
$Web_Put_Bin takes a single required string argument and returns a status code.
bin_string | A "binary" string that is added to the client buffer without any translation. Since the client buffer is always sent to the browser without translation, the binary contents of bin_string will be received by the browser. Under Sirius Mods Version 6.7 and later, $Web_Put_Bin is longstring capable: it can send a longstring with a length greater than 255 bytes. |
---|
Code | Meaning |
---|---|
0 | Binary string sent to the client buffer. |
-1 | Invalid call, not a Web thread |
-4 | Missing argument |
%X = $Web_Type('binary/jpeg') %X = $Web_Put_Bin( %COMPANYX_LOGO ) STOP
This sample shows a binary image in .jpg format being sent from a %variable to the client buffer (the image would have to be pretty small, given the 255 byte limitation on %variables).
Note that another way to send binary data is to store it in a Model 204 procedure and send it to the client using $Web_ProcSend.