Using free Gemini AI API to analyze email attachments

Hello. I would like to analyze the attachments of an incoming mail automatically with Gemini AI. As a first exercise it should simply produce a small summary of the attachment. Currently my scenarios works in the following stepts. Watch emails (from gmail), upload a file to google drive, upload a file to Google Gemini AI, Create a completion. Although the upload to Gemini runs without any error message, i am not able to configure the completion correctly. it seems that it simply does not recognizes the uploaded file and gives me an error message.
here is how i configured the message that leads to an error
Role: User
Message Type: File
Mime Type: “Mime Type” (from upload a file to Google Gemini AI)
File URI: “Uri” (from upload a file to Google Gemini AI)
I have tried both AI models “Gemini 2.5 Flash” and “Gemini 2.0 Flash Experimental”

Does anybody of you have an idea what the problem is? Is it possible that the free Gemini API does not allow the analysis of uploaded files although it does not create any error messages when uploading?
Thanks a lot for your help on this. If