+ Start a Discussion
Sunil kumar MahamkaliSunil kumar Mahamkali 

How to send files (attachments ) from lightning component to apex method for sending a email??????

I need to send email with name, email, description, attachments in lightning component 
I am able to send all the details from component.Js to apex except attachments.... I am using <lightning:input type="file" auraid="fileid" Value="{! V. Attachments} accept=" *allfiles" Onchange= "{!c.handlechange}" > 
I would like to know how to send this attachment to apex method from contoller along with other email, name, description fields 
???????????? 
Danish HodaDanish Hoda
Hi Sunil,
Not sure if it would work, but try sending the file to server side by JSON.Stringify(component.get("v.Attachments"));
And deserialize the sent string into BLOB value.