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.