Akshay

Akshay

  • 1.6k
  • 101
  • 33.2k

How to Send local file on Whats app with the Twilio API in c#

Sep 17 2022 7:37 AM
var path = new Uri("file:/C:/test/file.txt").LocalPath;

var message1 = MessageResource.Create(
mediaUrl: new List<Uri> { new Uri(path) },
from: new Twilio.Types.PhoneNumber("whatsapp: +911234567890"), 
 body: "Good morning", 
to: new Twilio.Types.PhoneNumber("whatsapp:+911234567890"));

Hii

I'm facing one problem while sending a file on whatsapp. I want to send a file which is saved  in a folder on c:.

How to convert this local path into uri so that i can send file using mediaurl

Thanking you


Answers (1)