BlobDownloadLink
(Created page with "When you tag a ViewModelColumn with BlobDownloadLink - the UI will render this as a download. It will use the controller named GetVMFile to allow for a download of content typ...")
 
(Adding page to Category:TOC because it contains a TOC.)
 
(14 intermediate revisions by 5 users not shown)
Line 1: Line 1:
When you tag a ViewModelColumn with BlobDownloadLink - the UI will render this as a download. It will use the controller named GetVMFile to allow for a download of content type application/octet-stream.
===== How to Use It =====
If your request has accept-encoding:gzip - then we will gzip the file on the server before sending it back. The server will tag the response header like this:
When you tag a ViewModelColumn with ''BlobDownloadLink=true,'' the UI will render this as a download link.
content-encoding:gzip
content-length:16660
content-type:application/octet-stream


The content-length will in this case be the zipped length
===== File Content =====
It will use a call to GetVMFile on the Turnkey server to allow for a download of content type application/octet-stream.
 
If your request has '''accept-encoding:gzip''' set - then we will gzip the file on the server before sending it back.
 
===== Content Type =====
If your ViewModelColumn for data is "MyColumn" - and you add a ViewModelColumn called '''MyColumn_ContentType''' on the same ViewModel nesting (this need not be shown but must exist) - and that attribute is of type string - then the GetVMFile will use this content type when downloading the file (it must follow web standards https://www.sitepoint.com/mime-types-complete-list/).
 
===== File Name =====
The ViewModelColumn that was tagged with BlobDownloadLink may be accompanied by a '''FileName''' column. '''Note!''' '''Case sensitive.'''
 
If your tagged column was MyColumn - and you add a '''MyColumn_FileName''' on the same nesting (this need not be shown on screen but must exist in the ViewModel) - and that column is of type string - then the GetVMFile will mark the response as an attachment with a set file name.
 
Note that the filename is set during upload so this column needs to exist in the uploaded ViewModel.
 
===== Response Headers =====
The server will tag the response header when downloading like this:
content-encoding:gzip
content-length:16660
content-type:application/octet-stream
The content length will in this case be the zipped length.
 
If you want control of exactly how the GetVMFile URL is formed, look at [[The ExternalId explained]].
[[Category:Tagged Values]]
{{Edited|July|12|2024}}
 
[[Category:TOC]]

Latest revision as of 13:45, 26 March 2024

How to Use It

When you tag a ViewModelColumn with BlobDownloadLink=true, the UI will render this as a download link.

File Content

It will use a call to GetVMFile on the Turnkey server to allow for a download of content type application/octet-stream.

If your request has accept-encoding:gzip set - then we will gzip the file on the server before sending it back.

Content Type

If your ViewModelColumn for data is "MyColumn" - and you add a ViewModelColumn called MyColumn_ContentType on the same ViewModel nesting (this need not be shown but must exist) - and that attribute is of type string - then the GetVMFile will use this content type when downloading the file (it must follow web standards https://www.sitepoint.com/mime-types-complete-list/).

File Name

The ViewModelColumn that was tagged with BlobDownloadLink may be accompanied by a FileName column. Note! Case sensitive.

If your tagged column was MyColumn - and you add a MyColumn_FileName on the same nesting (this need not be shown on screen but must exist in the ViewModel) - and that column is of type string - then the GetVMFile will mark the response as an attachment with a set file name.

Note that the filename is set during upload so this column needs to exist in the uploaded ViewModel.

Response Headers

The server will tag the response header when downloading like this:

content-encoding:gzip
content-length:16660
content-type:application/octet-stream

The content length will in this case be the zipped length.

If you want control of exactly how the GetVMFile URL is formed, look at The ExternalId explained.

This page was edited 44 days ago on 03/26/2024. What links here