Commit 412624df authored by Ranathunge R. A. D. O's avatar Ranathunge R. A. D. O

Added index.html

parent ef3b1de0
<center>
<br>
<h4>Select an Audio File</h4>
<form id="audio" method="POST" enctype="multipart/form-data">
<input type="file" accept="audio/*" name="file"/>
<br><br><br>
<input type="submit" value="Analyze"/>
</form>
<br><br><br>
<img id="img" src="https://www.aucshow.net/assets/frontend/global/img/Processing.gif" style="display: none;"/>
<h2 id="response" style="display: none;"></h2>
</center>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$("form#audio").submit(function(e) {
e.preventDefault();
var formData = new FormData(this);
$("#img").css("display", "block");
$.ajax({
url: "http://localhost:5000",
type: 'POST',
data: formData,
success:function(response){
console.log("Resss: "+response);
$("#img").css("display", "none");
$("#response").html(response.toString());
$("#response").css("display", "block");
},
error: function (jqXHR, exception) {
alert("Error");
$("#img").css("display", "none");
$("#response").html(exception);
$("#response").css("display", "block");
},
cache: false,
contentType: false,
processData: false
});
});
</script>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment