Prefect server exposes a GraphQL api, from where you can do a bunch of things, including triggering a flow run with certain parameters.
So you need to create your own 'sensor', which fill simply send a GraphQL request to trigger a flow with the filename as a Parameter.
How your sensor works will depend on where you store your files. Cloud storages like aws s3 can send notifications on file creation, from which you can trigger anything really.
This post describes the same idea:
https://medium.com/the-prefect-blog/event-driven-workflows-with-aws-lambda-2ef9d8cc8f1a