aws/invoice/index.html
2023-02-05 19:45:38 +01:00

26 lines
1.1 KiB
HTML

<html lang="en">
<head>
<script>
async function parse(){
document.getElementById("result").innerHTML = "Dodawanie pliku..."
var data = new FormData()
data.append('file', document.getElementById("docpicker").files[0])
document.getElementById("result").innerHTML = "Przetwarzanie faktury ... "
resp = await fetch('https://9kpwan8769.execute-api.us-east-1.amazonaws.com/textract/bucket-textract-s478874/prod.pdf', {method: "PUT", body: data})
document.getElementById("result").innerHTML = "Info"
data = await resp.json()
fetch('https://gp1q182wu2.execute-api.us-east-1.amazonaws.com/read', {method: "GET"})
.then((res) => {console.log(res);document.getElementById("test").innerHTML = JSON.stringify(res)})
}
</script>
<title>Invoice parser</title>
</head>
<body>
<input type="file" id="docpicker" accept=".pdf" onchange="parse()" />
<p id="result">...</p>
<p id="test">...</p>
</body>
</html>