To display a thumbnail of the uploaded file immediately within your web page, use the On-demand Image URL:-
<img
src="<<API_HOST>>/api/v1/assets/{ASSET_ID}/conversions?resize=WIDTH,HEIGHT"
/>
Replace {ASSET_ID}
with the actual file ID and set the resize WIDTH
, HEIGHT
parameters.
An example on-demand URL would look like below:-
<img
src="<<API_HOST>>/api/v1/assets/0c3c6d026858460abc4de1dcb4de15ac/conversions?resize=180,180"
/>
For large images and cloud files, the thumbnail URL would initially return a low-resolution image. A short expiration time will be returned in HTTP response header in this case. The URL will be updated with a high-resolution image after the file is processed.
Note that once the image is processed, you should use the CDN URL for On-demand Images to ensure fast delivery.