aws/invoice/index.html
2023-02-05 19:40:55 +01:00

27 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()
resp_db = await fetch('https://gp1q182wu2.execute-api.us-east-1.amazonaws.com/read', {method: "GET", body: ""})
var result = JSON.stringify(resp_db)
document.getElementById("result").innerHTML = result
}
</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>