Files are automatically rendered inside the browser if the browser can view those files. A file preview will only be shown of the file types which are supported by the browsers. To make the file downloadable, make sure it is from the same origin.
The parameters for FileItem are:
Name | Type | Default | Values | Description |
---|---|---|---|---|
icon | string | ftblank | ftblank, ftexcel, ftdoc, ftpdf | the icon to display for the file type |
url | string | - | # | the url of the file being downloaded/opened |
alt | string | File to Download | - | the alternate text to display if your file is not rendered by the browser |
title | string | Download File | - | the name of your file |
linkOpenTarget | string | tab | tab, download | whether the file should be downloaded or opened in a new tab |
showPreview | boolean | false | true, false | whether the file preview should be shown for the supported files. Files of type pdf, images are supported. |
mimeType | string | - | application/pdf, image/png, etc | mimeType is needed to preview the file. A valid mimeType should be passed. Reference https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Complete_list_of_MIME_types |
An example of FileItem markup is (with preview):
An example of FileItem markup is (without preview):