Hans Karlsen (talk | contribs) No edit summary |
No edit summary |
||
Line 10: | Line 10: | ||
If your tagged columns was MyColumn - and you add a '''MyColumn_FileName''' on the same nesting (this need not be shown but must exist) - and that column is of type string - then the GetVMFile controller will mark the response as attachment with result as a file name. | If your tagged columns was MyColumn - and you add a '''MyColumn_FileName''' on the same nesting (this need not be shown but must exist) - and that column is of type string - then the GetVMFile controller will mark the response as attachment with result as a file name. | ||
If you want control of exactly how the GetVMFile URL is formed, look at [[The ExternalId explained]] | |||
'''New 2019-05-26''': If your tagged columns was MyColumn - and you add a '''MyColumn_ContentType''' on the same nesting (this need not be shown but must exist) - and that column is of type string - then the GetVMFile controller will use this content type when downloading the file [must follow web standards https://www.sitepoint.com/mime-types-complete-list/]. | '''New 2019-05-26''': If your tagged columns was MyColumn - and you add a '''MyColumn_ContentType''' on the same nesting (this need not be shown but must exist) - and that column is of type string - then the GetVMFile controller will use this content type when downloading the file [must follow web standards https://www.sitepoint.com/mime-types-complete-list/]. |
Revision as of 10:24, 8 July 2019
When you tag a ViewModelColumn with BlobDownloadLink = true - 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. 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: content-encoding:gzip content-length:16660 content-type:application/octet-stream
The content-length will in this case be the zipped length
The viewModelColumn that was tagged with BlobDownloadLink may be accompanied by a FileName column. Note! Case sensitive. Note that the filename is set during upload so this column need to exist in the upload view model.
If your tagged columns was MyColumn - and you add a MyColumn_FileName on the same nesting (this need not be shown but must exist) - and that column is of type string - then the GetVMFile controller will mark the response as attachment with result as a file name.
If you want control of exactly how the GetVMFile URL is formed, look at The ExternalId explained
New 2019-05-26: If your tagged columns was MyColumn - and you add a MyColumn_ContentType on the same nesting (this need not be shown but must exist) - and that column is of type string - then the GetVMFile controller will use this content type when downloading the file [must follow web standards https://www.sitepoint.com/mime-types-complete-list/].