Telegram Bot API: How to get MIME type of received photos

The telegram API for the method getFile. This function may not preserve the original file name and MIME type. You should save the file’s MIME type and name (if available) when the File object is received.

If everything is clear with the name. How to change the content-type:image/jpeg at the output ?
I send it to S3, it saves a file with content-type: application/octet-stream.

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

Hey @Shurum_Burum,

Welcome to the community :tada:

Best I can think of would be to use a code node with the below in it…

for (const item of $input.all()) {
  item.binary.data.mimeType = 'image/jpeg'
}

return $input.all();

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.