Sounds like it may be a good case for using Moodle's web services. I believe there is a core web service that can be used to search for files and it returns download URLs as part of the response. If the core service wouldn't work for your application creating a custom one might.
General developer forum
External Application File Download
This discussion has been locked so you can no longer reply to it.