Page 1 of 1

Image is currepted using SendGrid API

Posted: Thu Nov 20, 2014 6:02 am
by Rajani Parth

Hello,

i used sendGrid api for sending mail
but i want also send image attchment from Appery database
i refere this document : http://blog.bismallion.com/sending-em...
here in mail i get attachment but it's currepted
iin my appery databse image is stored as a binary formate and i completed follow above link yet why my image is courepted.??


Image is currepted using SendGrid API

Posted: Thu Nov 20, 2014 6:23 am
by Evgene Karachevtsev

Hello Rajani,

Could you please clarify did you try to send only an image or other files got broken too?


Image is currepted using SendGrid API

Posted: Thu Nov 20, 2014 6:28 am
by Rajani Parth

Here in mail some text description and in attachment theres is images only currepred


Image is currepted using SendGrid API

Posted: Thu Nov 20, 2014 6:34 am
by Evgene Karachevtsev

Rajani,

Please detail, what is the file extension of the image?


Image is currepted using SendGrid API

Posted: Thu Nov 20, 2014 6:36 am
by Rajani Parth

var content = 'here is binary image data';
// Read file content first
var blob = new Blob([content], { type: "image/jpeg"});

var fileName = 'ZZZ.jpeg'
// Read file name first
formData.append("files[" + fileName + "]", blob);


Image is currepted using SendGrid API

Posted: Thu Nov 20, 2014 6:39 am
by Rajani Parth

i refered following tutorial : http://blog.bismallion.com/sending-em...


Image is currepted using SendGrid API

Posted: Thu Nov 20, 2014 10:21 pm
by Alena Prykhodko

Hello,

You haven't read the image file itself.
1) Read the file first
2) Save received data to content variable
3) Use content variable to send it with custom service implementation