Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to detect file content/media type of incoming attachment #40

Open
SzymonPek opened this issue Mar 14, 2024 · 0 comments
Open

How to detect file content/media type of incoming attachment #40

SzymonPek opened this issue Mar 14, 2024 · 0 comments

Comments

@SzymonPek
Copy link

Hi Team,
Is there a way how we can detect what is content type of file that is attached under url attribute in incoming message? Or the type of the file is always the same, VIDEO will be always mp4 format so it will be "video/mp4" and Infobip VOICE will be always "audio/ogg"?
Context:
When we receive incoming message with url we want to check what is the contentType so we can store in our our S3 bucket. To do it we need MIME Type of the file.
To download file we use Infobip Java Client downloadWhatsAppInboundMedia().execute() but this is returning File object without extension. We tried also usage of your example with WhatsAppWebhookInboundMessageResult approach but all we get there is Infobip specific types like VOICE or IMAGE, but no details around extension.

While we acknowledge the possibility of retrieving this information via classic HTTP Requests and parsing the headers, we strive to maintain consistency in our integration and continue leveraging the Infobip API Client without introducing unnecessary complexity.
Could you kindly advise if there's a method within the Infobip Java Clientthat allows us to obtain MIME Type or file extension directly from the received message?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant