Making a simple app that would return the file type

I’m making a very simple app that would take a file as input and produce the file type as output.

I’m getting the following error: -

AttributeError: '_io.BufferedRandom' object has no attribute 'type'

The code is given as follows: -

def file_type(file):
return str(file. Type)

input1 = gr.File(label=“Cyrillic”)

iface = gr.Interface(
inputs=gr.File(label=“Upload a file”),

ChatGPT is not helping much in this case.