Displaying Parts of a Text
The text/plain: substr transformation is available to display only a part of the text.
Here are the options:
First: where to start in the text (default: 0)
Second: how many characters (default: all the remaining text)
Third: what to display as a suffix to show that truncation has occurred
(default: ...)
Remember that $cfg['LimitChars'] is doing a character truncation for every nonnumeric
field, so text/plain: substr is a mechanism for fine-tuning this, field-by-field.
??? ??? ???
MIME-Based Transformations
[ 248 ]
Download Link
Let's say we want to store a small audio comment about each book, inside MySQL.
We add to the book table a new field, with name audio_contents and type
MEDIUMBLOB, to the book table. We set its MIME type to application/octetstream
and choose the application/octetstream: download transformation. In the options,
we insert 'comment.wav'.
This MIME type and extension will inform our browser about the incoming data,
and the browser should open the appropriate player. To insert a comment, we first
record it in .wav format and then upload the contents of the file into the audio_
contents field for one of the books. When browsing our table, we can see a link for
our audio comment.
Hexadecimal Representation
Characters are stored in MySQL (as in computers in general) as numeric data, and
converted into something meaningful for the screen or printer.
Pages:
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229