Twilio: how to add name to media while sending message?


I’m using npm module

https://www.npmjs.com/package/@twilio/conversations

I’m sending media with below code:

props.conversationProxy.sendMessage({
  contentType: event.target.files.files[0].type,
  filename:event.target.files.files[0].name,
  media: event.target.files.files[0]
});

I have tried below for file names, but nothing works

file_name:event.target.files.files[0].name,

fileName:event.target.files.files[0].name,

FileName:event.target.files.files[0].name, 

file:event.target.files.files[0].name, 

name:event.target.files.files[0].name

getting below from twilio:

{ 
contentType: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
​​
filename: null
​​
sid: "MEXXXXXXXXXXXXXXXXXXXXXXXXXX"
​​
size: 4697
}

I want to send media with filename.

Source: React – Stack Overflow

September 22, 2021
Category : News
Tags: reactjs | twilio | twilio-api

Leave a Reply

Your email address will not be published. Required fields are marked *

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.