sql. Loading file from SQL-server

^file::sql{query}
^file::sql{query}
[$.name[name] $.content-type[content-type] $.limit(1) $.offset(o)]

Loads file from SQL-server. Result of query execution must be one record (use limit option in needed). Parser considers its
·first column contains file body;  
·second column contains file name;  
·third column contains content-type of the file (if not specified, it will be determined by $MIME-TYPES table).  

Optional parameters:
$.limit(1) - limit response to one row only; [3.3.0]
$.offset(o)-ignore first o retrieved entries; [3.3.0]
File
name and content-type may be also specified as a parameters. [3.1.4]

File name and its
content-type will be passed to visitor if $response:download is used.

Note: for now only MySQL server is supported.


Copyright © 1997–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 03.07.2008