Reading files in site public/*

OK, let me simplify the question.

I believe javascript can open files (perhaps a bit like PHP). Is there such a function in WIX.
Also, are the public/*.js files accessible via a url?

Alternatively is the an API to upload or download these files?

Lawrence