Forums

url access to files

Hi there

Could somebody possibly help me with the following?:-

I have a number of audio files that I want to be accessible using an http request.

say i have 5 mp3 files in a folder, then my webapp gets an http request with a query string which matches one of the mp3 filenames.

how would i then route the request to that file (I don't need to play anything on the page. it will be a remote request to play the audio file on a different device).

Thank you v much

Kind regards

Paul

Hello again

Sorry, I always seem to find the answer, just after I post the question.

If it helps anyone else:-

You need to configure the static files section in the web tab. This, as far as I understand, maps whatever directory(s) you choose to a URL of your choice.

This means that, whatever file(s) you put in the folder can be viewed/used independently of the webapp.

So in my case, I mapped a directory called '/static/' to a URL directory called '/public/' then put an mp3 file called 'test.mp3' in the directory.

the URL .........../public/test.mp3 plays the mp3 file.

(this is probably blinding obvious to most, but it might help someone else like me)

Many thanks

Paul

thanks for posting the answer as well! i'm sure future people searching for this topic will appreciate it :)

Thank you for sharing your experience. I have found another good explanation here:

URL and static files

That's the resource nr 1