Const
Downloads a blob as a file. Supports both modern browsers and IE.
Blob to download
Name of the file to save as
const blob = new Blob(['Hello World'], { type: 'text/plain' });
FileUtils.downloadBlob(blob, 'hello.txt');
Extracts base64 data from a local URL.
URL containing base64 data
Base64 string or original URL if no base64 data found
const base64 = FileUtils.extractBase64FromLocalUrl('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...');
Gets a base64 preview of an image file.
Image file to preview
Promise resolving to base64 string of the image
Error if file is not an image or fails to load
const preview = await FileUtils.getImagePreview(imageFile);
Utility object containing file handling functions.