How would you handle image upload?

ADEKOLA Abdwahab - Mar 21 - - Dev Community

User uploads profile picture.

Images are converted into URLs via third party asset storage.

Backend handles the conversion.

Which of the scenarios below would you adopt and why?

A. Frontend should call convertImageToUrl endpoint, then call updateprofilepicture endpoint with the image url.

B. Frontend should call updateprofilepicture endpoint with the raw image - so backend handles the conversion to url in that endpoint implementation.

What are your reasons?

. . . . . . . . . . . . . . . . . . . . . . .