Ahmed_Mostafa
Ahmed_Mostafa

Reputation: 23

validate with joi before upload files with multer

I'm using Multer to upload files to an endpoint and also using Joi to validate the data and image will be uploaded to that endpoint the issue is that I should use Multer before the Validation which leads to uploading the files to the server even if the validation failed and if I put the validation before the Multer the validation failed because it doesn't find the image to validate on it so how could I stop uploading the image until the Joi validation passes?

Upvotes: 0

Views: 37

Answers (0)

Related Questions