imageExtensionCheck
talawa-api • Docs
talawa-api / utilities/imageExtensionCheck / imageExtensionCheck
Function: imageExtensionCheck()
> imageExtensionCheck(filename
): Promise
<void
>
Checks the file extension of the given filename. If the extension is not 'png', 'jpg', or 'jpeg', deletes the file and throws a validation error.
Parameters
• filename: string
The name of the file to check
Returns
Promise
<void
>