Decoding base64 Stream to image

前端 未结 2 912
夕颜
夕颜 2020-12-31 09:05

I am sending base64 encoded image from client side using javascript (I am creating Screenshot uploader applet for asp.net application using http://supa.sourceforge.net/) and

2条回答
  •  情话喂你
    2020-12-31 09:39

    I needed to do something similar, but wanted to work directly with the InputStream, so used this to do the decoding:

    // using System.Security.Cryptography
    var stream = new CryptoStream(Request.InputStream, new FromBase64Transform(), CryptoStreamMode.Read);
    var img = Image.FromStream(stream);
    

提交回复
热议问题