Yes, you can fetch the records by writing your desired query.
- You have to select the object from the "Select Object" drop-down.
- In "Search Mode", you have to select "Advanced Search(SOQL)".
- Now, in the input box, enter your query.
When the Toggle is OFF - Just hit the Save button to attach the file to records you have added the SOQL query for.
When the Toggle is ON - Hit the Run Query button to retrieve the records you have added the SOQL query for.

PS: View Mass File Upload, Salesforce file upload app on Salesforce AppExchange: https://appexchange.salesforce.com/appxListingDetail?listingId=82cf236b-1ee8-4ea7-aebf-fd0c89fb93bd