0

I'm trying to convert an image to a base64 string.

I am using an Html code to get the input image from the user. The image is of type file. In my Javascript program I made the following call and received a string that looked similar to a base64,

var name = document.getElementById("client_image").src;

where "client_image" is the id of the file in html.

My problem is that when I pass image to post to the server I get a FormatException thrown saying that I do not have a proper base64 string.

Anyway I can fix this? Also, is there any other way I can post an uploaded image to the server?

Please Help.

Muraad
  • 1,110
  • 1
  • 9
  • 14
  • 1
    What does C# have to do with this? – Sterling Archer May 20 '14 at 19:38
  • i am using c# to post the image to the server – Muraad May 20 '14 at 19:41
  • Your question doesn't have a mention of C#, so even if you're using it outside the scope of this question, it's irrelevant here (not a big deal, just explaining) – Sterling Archer May 20 '14 at 19:46
  • thats true, sorry about that – Muraad May 20 '14 at 19:47
  • I have tried all the answers that were suggest for the other question and none of them worked for me , that is the reason why i asked my own question. I have been stuck on this problem for quite some time now and was wondering if someone can give me an answer different to the answers posted to the other question . thank you – Muraad May 21 '14 at 14:19

0 Answers0