How to Use It[<a href="/index.php?title=Documentation:BlobDownloadLink&veaction=edit§ion=1" class="mw-editsection-visualeditor" title="Edit section: How to Use It" data-bs-title="Documentation:BlobDownloadLink">edit</a> | <a href="/index.php?title=Documentation:BlobDownloadLink&action=edit§ion=1" title="Edit section: How to Use It" data-bs-title="Documentation:BlobDownloadLink">edit source</a>]
When you tag a ViewModelColumn with BlobDownloadLink=true, the UI will render this as a download link.
File Content[<a href="/index.php?title=Documentation:BlobDownloadLink&veaction=edit§ion=2" class="mw-editsection-visualeditor" title="Edit section: File Content" data-bs-title="Documentation:BlobDownloadLink">edit</a> | <a href="/index.php?title=Documentation:BlobDownloadLink&action=edit§ion=2" title="Edit section: File Content" data-bs-title="Documentation:BlobDownloadLink">edit source</a>]
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[<a href="/index.php?title=Documentation:BlobDownloadLink&veaction=edit§ion=3" class="mw-editsection-visualeditor" title="Edit section: Content Type" data-bs-title="Documentation:BlobDownloadLink">edit</a> | <a href="/index.php?title=Documentation:BlobDownloadLink&action=edit§ion=3" title="Edit section: Content Type" data-bs-title="Documentation:BlobDownloadLink">edit source</a>]
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 <a target="_blank" rel="nofollow noreferrer noopener" class="external free" href="https://www.sitepoint.com/mime-types-complete-list/">https://www.sitepoint.com/mime-types-complete-list/</a>).
File Name[<a href="/index.php?title=Documentation:BlobDownloadLink&veaction=edit§ion=4" class="mw-editsection-visualeditor" title="Edit section: File Name" data-bs-title="Documentation:BlobDownloadLink">edit</a> | <a href="/index.php?title=Documentation:BlobDownloadLink&action=edit§ion=4" title="Edit section: File Name" data-bs-title="Documentation:BlobDownloadLink">edit source</a>]
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[<a href="/index.php?title=Documentation:BlobDownloadLink&veaction=edit§ion=5" class="mw-editsection-visualeditor" title="Edit section: Response Headers" data-bs-title="Documentation:BlobDownloadLink">edit</a> | <a href="/index.php?title=Documentation:BlobDownloadLink&action=edit§ion=5" title="Edit section: Response Headers" data-bs-title="Documentation:BlobDownloadLink">edit source</a>]
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 <a href="/Documentation:The_ExternalId_explained" title="Documentation:The ExternalId explained" data-bs-title="Documentation:The_ExternalId_explained">The ExternalId explained</a>.