0

I am trying to get the location of a wav file on my FLASK server but cannot figure it out... I am getting the following errors:

GET http://127.0.0.1:5000/EQlZgVWRneYWBBH.wav 404 (NOT FOUND)
GET http://127.0.0.1:5000/EQlZgVWRneYWBBH.wav net::ERR_ABORTED 404 (NOT FOUND)

Thanks for your help!

This is my directory structure:

root
├── randomfilename.wav
├── app
|   |── init.py
│   |── templates
        └──myhtml.html
|── start.py

This is my html code:

<audio controls>
<source id="audioid" src= "" type="audio/wav">
</audio>

<script>
    var randomfilename = {{recording.randomfilename | tojson}}
    var randomfilenameUrl = './' + randomfilename + '.wav'
    console.log(randomfilenameUrl)
   document.getElementById('audioid').setAttribute('src', randomfilenameUrl);
   
</script>
Barmar
  • 741,623
  • 53
  • 500
  • 612
peti2ty
  • 11
  • 3
  • Maybe this is relevant: https://stackoverflow.com/questions/20646822/how-to-serve-static-files-in-flask – Barmar Sep 09 '22 at 16:32

0 Answers0