Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
275 views
in Technique[技术] by (71.8m points)

asp.net - C# blob to image and preview it

Good morning, I'm new to C# I need guidance how to convert Blob to Image and showing it on http

this is the code I'm using to convert Base64string to image on ASPX.CS it says error "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."

        DataRow dr = ds.Tables[0].Rows[0];
        string base64string = dr["img_ktp"].ToString();
        byte[] blob = Convert.FromBase64String(base64string);
        File.WriteAllBytes(@"C:UsersuserDesktopest.jpg", blob);

This is how I'm planing to preview it on ASPX I really don't know hot to link this two

        <img [src]="ImageSource" />

Thanks appreciate your helps

question from:https://stackoverflow.com/questions/65557610/c-sharp-blob-to-image-and-preview-it

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...