Child pages
  • servoy_blobloader

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The Servoy Blobloader provides a convenient way to access files stored in a database column or a global variable and use it as if it were part of the Servoy Media library.

In the latest 3.1 beta's more functionality has been added, so if you have a global containing a file, you can use that as well, you can set the mime-type and filename as well.

for example, if you create a calculation with the following code, and place a HTML Area on your form with the Calc as DataProvider, then, in the WebClient, clicking the link would open the file.

Code: Select all
var URL = The Servoy Blobloader is a media URL, with arguments indicating where to retrieve the file from:

Code Block
titleBlobloader syntax to retrieve from the database
var URL = 'media:///servoy_blobloader?servername=' + currentcontroller.getServerName() + '&tablename=XXXXX&dataprovider=YYYYY&rowid1=' + ZZZZZ+'&mimetype='+AAAAA+'&filename='+BBBBBB
return '<html><body><a target="_blank" href="'+URL+'">test</a></body></html>';
Code Block
titleBlobloader syntax to retrieve from a global variable
var URL = 'media:///servoy_blobloader?global=''+'&mimetype='+AAAAA+'&filename='+BBBBBB
return '<html><body><a target="_blank" href="'+URL+'">test</a></body></html>';

Where:

  • XXXXX is the name of the table your file is stored in
  • YYYYYY is the columnname of the column where the file is stored
  • ZZZZZ is value of the PK field of the row (In case of a PK buildup out of multiple columns, add &rowid2=value ... &rowidXX=value)
  • AAAAA is the mimetype of the file
  • BBBBB is the name of the file