File
grupojaque-ngx-commons › Globals › "lib/helpers/file/file.helper"
File Helper
This module contains methods that directly interact with elements of type File
Index
Functions
Functions
fileToBase64
▸ fileToBase64(file
: File): Promise‹string | ArrayBuffer | null›
Defined in lib/helpers/file/file.helper.ts:42
This function convert a file to base64
Parameters:
Name | Type | Description |
---|---|---|
file | File | File to convert |
Returns: Promise‹string | ArrayBuffer | null›
Promise with reader.result
isValidFile
▸ isValidFile(file
: File, config
: FileValidationConfig): FileValidationErrorType
Defined in lib/helpers/file/file.helper.ts:18
This function evaluate a file according of the given configuration
Parameters:
Name | Type | Description |
---|---|---|
file | File | File to evaluate |
config | FileValidationConfig | Object that contains configurations for evaluate file |
Returns: FileValidationErrorType
Return of a response according to evaluated