Answer the question
In order to leave comments, you need to log in
How to "link" blob audio file resulting from audio recording and HTML(input file) form?
Guys, help advice.
I 'm running a Django application that takes data (photo+text_description+voice_description+music) and outputs a beautiful picture that sings :)
The essence of the problem is to record a voice on a page using a webcam and send an audio object to the server in a standard django form.
There are two ways to do this (I'm sure there are more, I just don't know about them). Either using Ajax, or somehow (here I need help) push the audio object into a standard django form (file input).
So.
As a result of voice recording, the following code is generated:
<audio controls="" src="blob:http://127.0.0.1:8000/c3b9e9ef-f81f-47e9-9001-ed92a018b4c5" id="recorded_audio"></audio>
<input id="id_voice_description" name="voice_description" type="file" required="">
var voice_description_link = $("#recorded_audio").attr("src");
$("#id_voice_description").val(voice_description_link);
jquery-3.2.1.min.js:4 Uncaught DOMException: Failed to set the 'value' property on 'HTMLInputElement': This input element accepts a filename, which may only be programmatically set to the empty string.
Answer the question
In order to leave comments, you need to log in
You cannot script to load data into input type="file"
, it is read-only. You have to use AJAX.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question