2023-02-05 19:26:53 +01:00
|
|
|
<html lang="en">
|
|
|
|
<head>
|
2023-02-05 19:40:55 +01:00
|
|
|
<script>
|
2023-02-05 19:26:53 +01:00
|
|
|
async function parse(){
|
2023-02-05 19:40:55 +01:00
|
|
|
|
2023-02-05 19:26:53 +01:00
|
|
|
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()
|
|
|
|
|
2023-02-05 19:40:55 +01:00
|
|
|
resp_db = await fetch('https://gp1q182wu2.execute-api.us-east-1.amazonaws.com/read', {method: "GET", body: ""})
|
|
|
|
var result = JSON.stringify(resp_db)
|
2023-02-05 19:26:53 +01:00
|
|
|
document.getElementById("result").innerHTML = result
|
2023-02-01 01:54:18 +01:00
|
|
|
}
|
2023-02-05 19:26:53 +01:00
|
|
|
</script>
|
2023-02-05 19:40:55 +01:00
|
|
|
<title>Invoice parser</title>
|
2023-02-05 19:26:53 +01:00
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<input type="file" id="docpicker" accept=".pdf" onchange="parse()" />
|
2023-02-05 19:40:55 +01:00
|
|
|
<p id="result">...</p>
|
|
|
|
<p id="test">...</p>
|
2023-02-05 19:26:53 +01:00
|
|
|
</body>
|
2023-02-01 01:54:18 +01:00
|
|
|
</html>
|