I'm trying to send a JPEG image to a website via internet. Should i encode the image to BASE 64 format to do this or simply send the JPEG as string
while converting it to Base64 String your image size will be increased around 37% to Original size, I would recommends to send JPEG as simply string, I got one sample for sending camera image to a web page, may be it is related to your query gadget.renesas.com/.../4.html Regards, Ritesh
In reply to RiteshGohil:
Thanks for the reply.But this example is for a web server.I want to send it to a website using a php script. I want to simply send the JPEG file content using AT+CIPSEND
In reply to jihas:
Okay! In that case Base 64 option is better because it gives us a encoded string in a proper format, I am finding other way round for this problem, mostly by passing an image as Binary file and imagecreatefromstring and imagepng function on php side.
The above code generates hex values starting at FF D8 .Copy the hex values from FF D8 to FF D9 at the end and copy it to a text file and save it as 'jpegimg.txt' Then run the following python code to regenerate the JPEG image import binascii#reading the file contains hex valuesf=open('jpegimg.txt','r')input_jpeg=f.read()#removing white spaces and newlines from readed stringinput_jpeg=input_jpeg.strip()input_jpeg=input_jpeg.replace(' ', '')print input_jpegf=open('testjpg.jpg','wb')f.write(binascii.a2b_hex(input_jpeg))f.close I'm planning to use python at server side to reproduce the jpeg Will upload the final code when ready