For document type fields, what I usually do is if I need to do some operations on the file is I create a field which saves the file internal id in it
And query the new field to get the file internal Id.
And do whatever I want in the script by loading that file.
If you need the file data not the file, then storing that data on a long test field might also work.