How to translate uploaded files?

For the app that I’m currently building, I have used the chatgpt API to translate input’s texts into different languages.

I want to make gpt to translate the uploaded file (word, pdf) in bubble app. Is there any methods for this? (just like google document translation feature)