Skip to main content

talawa-api / Exports / utilities/uploadImage

Module: utilities/uploadImage

Table of contents

Functions

Functions

uploadImage

uploadImage(newImageFile, oldImagePath): Promise<{ imageAlreadyInDbPath: string ; newImagePath: string }>

This function uploads the new image and deletes the previously uploaded image if exists.

Parameters

NameTypeDescription
newImageFileanyFile of a new Image with any type.
oldImagePathnull | stringFile of a current Image. It can be null.

Returns

Promise<{ imageAlreadyInDbPath: string ; newImagePath: string }>

Path of an uploaded image.

Remarks

This is a utility method.

Defined in

src/utilities/uploadImage.ts:16