English
getFilePreviewUrl
About 76 wordsLess than 1 minute
2025-12-16
This method returns the online preview URL of a file.
Syntax: FxUI.mediaApi.getFilePreviewUrl(file)
Parameters
| Parameter | Description | Type | Allowed Values | Default |
|---|---|---|---|---|
| file | File object | Object | — | — |
| file.filename | File name | String | — | — |
| file.path | File path | String | — | — |
| file.ext | File extension | String | — | — |
Example
This method returns the online preview URL of a file. Pass the file parameter containing the file path.
let file = {
filename: "1.2.doc",
path: "N_202210_27_362515560ff84c2b91e3962d2a285034",
ext: "doc"
};
FxUI.mediaApi.getFilePreviewUrl(file);
// //www.fxiaoke.com/dps/preview/bypath?path=N_202210_27_362515560ff84c2b91e3962d2a285034.doc