English
getImagePreviewUrl
About 98 wordsLess than 1 minute
2025-12-16
This method returns the online preview URL of an image.
Syntax: FxUI.mediaApi.getImagePreviewUrl(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 | — | — |
| options | Options | Object | — | — |
| options.width | Image width | number | — | 100 |
| options.height | Image height | number | — | 100 |
| options.ext | Image extension | string | — | webp |
| options.appId | Application ID | string | — | — |
Example
This method returns the online preview URL of an image. Pass the file parameter containing the file path.
let file = {
filename: "1.2.png",
path: "N_202210_27_362515560ff84c2b91e3962d2a285034",
ext: "png"
};
FxUI.mediaApi.getImagePreviewUrl(file);
// https://img.fxiaoke.com/image/i/N_202210_27_362515560ff84c2b91e3962d2a285034.png/100*100/webp