2

I'm trying to send an image in C++ using sockets.

The problem I'm facing is reading the image as binary base64 and then inserting it in a char array in order to send it.

I would really appreciate if you can help me or give me a tip on how to read the image as binary base64 then insert it into a char array.

Thank you!

1

1 Answer 1

2

You should first read the file as binary. And then use the read buffer to encode as base64 and send it over to the recipient. Try readying binaryIO in C++ and there are a lot of base64 libraries e.g. apache , openssl etc.

For Binary IO. Read binary file c++ http://courses.cs.vt.edu/cs2604/fall02/binio.html

Base64 : how to convert the binary string into base64 Encode data..?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.