The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.
I was trying to upload a file in client side and sending back the data from the client to Web API controller by angular service . Step 1 : I was doing it by. (It was bot the complete code ) function saveFile(file, cb) { var readerObj = new FileReader(); readerObj .readAsDataURL(file); readerObj .onload = function () { savedFileDataAsBase64Format(readerObj .result, file.name,cb); }; readerObj .onerror = function (error) { alert("Error in uploading the file."); }; Step 2 : This is my Web api controller action method. [HttpPost] [Route("api/FileInput/SaveBase64FileData/{fileName}")] public void SaveBase64FileData(string fileName, [FromBody]string fileData) { ...