File

grupojaque-ngx-commonsGlobals"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:

NameTypeDescription
fileFileFile 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:

NameTypeDescription
fileFileFile to evaluate
configFileValidationConfigObject that contains configurations for evaluate file

Returns: FileValidationErrorType

Return of a response according to evaluated