Menu

How to upload images (jpgs, pngs) from Vuejs to Asp.net core webservice

Recently I had to upload images from Vue Js to asp.net core API, a simple approach is to send the image as base 64 encoded string then save it on the database/Azure blob storage. If the application is not open to the public (internal app – office use) we can consider saving the file to disk, but that is only you host it in none cloud strange as Azure has limited disk space in the web hosting.

I will not post the code of the asp.net core app, as its a matter of getting the base 64 string and saving it to file/blob storage – pretty easy. I have posted similar in the past, or ask you good friend Google.

I will not post entire code here, but only the necessary code bits.

Type script (.ts)

Base64ImageHelper.ts

 

Leave a comment