Hi I was exploring Invenio-Files-Record module for the user to access the content of the files without having to download the files locally. My goal is for the user to process on the file without actually downloading it , just by calling the invenio db methods and work on it.
I looked through the content of uploading and retrieving files to the bucket, but none of these has methods to actually read the content of the file, can someone please help on how do actually read or access the content to the file?
I have tried something like
files = Record(record)
fileobj = record.files[‘hello.txt’]
with fileobj.storage.open(‘rb’) as file:
file_content = file.read().decode(‘utf-8’)
and
file_content = fileobj.read().decode(‘utf-8’)
print(file_content)
but none of these seems to be working as ‘ObjectVersion’ object has no attribute ‘storage’.
Can someone please help?