BlobDownloadLink
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 158 days ago on 06/17/2024. What links here