Hans Karlsen (talk | contribs) No edit summary |
Hans Karlsen (talk | contribs) No edit summary |
||
Line 5: | Line 5: | ||
<nowiki>http://localhost:5052/Turnkey/GetImage?img=9!10-SomeImage-application%2Fpdf</nowiki> will use application/pdf as content type. | <nowiki>http://localhost:5052/Turnkey/GetImage?img=9!10-SomeImage-application%2Fpdf</nowiki> will use application/pdf as content type. | ||
This controller may be used by angular views as well - if you want to construct a link to download a file or something without actually having the attribute loaded (if it is marked as delayed fetch) | This controller may be used by angular views as well - if you want to construct a link to download a file or something without actually having the attribute loaded (if it is marked as delayed fetch). | ||
New: Now you can return Text content this way also. | |||
For security concerns use the AllowMVCAccess tagged value on the attribute: this is default "ok" for byte[] and default notok for strings, you can also set okwhenauthenticated. No accessgroup evaulation is provided for GetImage. | |||
See also [[The_ExternalId_explained]] to create a more long lived link | See also [[The_ExternalId_explained]] to create a more long lived link |
Revision as of 10:10, 27 October 2021
MVC we have a controller GetImage that expects a object identity and a attribute with a blob, like this: http://localhost:5052/Turnkey/GetImage?img=9!10-SomeImage
You may append yet another section with '-' that denotes contenttype header to send to browser:
http://localhost:5052/Turnkey/GetImage?img=9!10-SomeImage-application%2Fpdf will use application/pdf as content type.
This controller may be used by angular views as well - if you want to construct a link to download a file or something without actually having the attribute loaded (if it is marked as delayed fetch).
New: Now you can return Text content this way also.
For security concerns use the AllowMVCAccess tagged value on the attribute: this is default "ok" for byte[] and default notok for strings, you can also set okwhenauthenticated. No accessgroup evaulation is provided for GetImage.
See also The_ExternalId_explained to create a more long lived link