user1203692
user1203692

Reputation: 21

How to generate image from request servlet

http://www.wupload.com/file/2662484487/example.rar -- pls download this to see that string

I have string that contains imageId, imageName and image content.

First I substring it for only the image content (jpg format) and convert that image content to Base64, but when I convert Base64 to image, I've got this error:

not a jpeg file

Any suggestion? I think problem is encoding...

Sorry for my English.

Upvotes: 1

Views: 213

Answers (1)

JZares
JZares

Reputation: 307

shouldn't you put the image content in a byte array instead in a string? I had a project once about compressing images and whenever I put the image content inside a string the byte arrangement of the image seems to change.

Upvotes: 1

Related Questions