title: How to name a audio file when saving into server with POST
body: <p>I've being developing a solution for my webpage with Django and javascript, it's a record button so that the user can send feedback and I can store it into the server. </p>
  
  <p>The plan is putting a text input where the user can introduce its name and a file is created with that name. This is my code by now. Can anyone help me with this?</p>
  
  <blockquote>
    <p>Python views.py</p>
  </blockquote>
  
  <pre><code>def voice_request(request):
      f = open('./Grabaciones/file.wav', 'wb')
      f.write(request.body)
      f.close()
      return HttpResponse('audio received')
  </code></pre>
  
  <blockquote>
    <p>Javascript part</p>
  </blockquote>
  
  <pre><code>function sendData(data) {
    let csrftoken = getCookie('csrftoken');
    let response=fetch("/salud/voice_request/", {
    method: "post",
    body: data,
    headers: { "X-CSRFToken": csrftoken },
    })
  }
  </code></pre>