Convert a file from to Base64 using JavaScript and converting it back to file using C#

前端 未结 2 430
长发绾君心
长发绾君心 2021-01-27 02:57

I am trying to convert pdf and image files to base 64 using javascript and convert it back to file using C# in WEB API.

Javascript

var filesSelected = do         


        
2条回答
  •  醉酒成梦
    2021-01-27 03:22

    According to MDN: FileReader.readAsDataURL those generated URLs are prefixed with something like data:image/jpeg;base64,. Have a look at your generated string. Look for the occurence of base64, and take the base64 data that starts after this prefix.

提交回复
热议问题