Return parameters from a File Resource object


How do I access the parameters of a FileResource object? Specifically, I would like to return the source and filename. Below is a screenshot of what I’m trying to access, within the params.



Hi Charlie,

Please have a look at the FileResource; you can obtain the file (type File) and filename as properties:

resource = ...  # FileResource

filename = resource.filename 

file = resource.file  # File object
file_content = file.getvalue()