How to attach (client side generated) excel file to email

Thanks @Steve-Mcl for your reply. I got working with the excel download. Just small bug in my header file. It is just testing with my buffer payload.

Thank you again for your help.