OIDC test - test jumbojett oidc round two change root paths

This commit is contained in:
matt committed 2026-10-28 21:56:05 -07:00
1 parent 4b7abac7ca
commit 07d3895eb5
6 files changed
+6 -6

No files matched your search

+38
View File
@@ -0,0 +1,38 @@
<!-- index.html (served by PHP) -->
<input type="file" id="photo" style="display:none;">
<div id="drop" style="border:2px dashed #bbb; padding:20px;">
Drag photo here or click to choose
</div>
<script>
const drop = document.getElementById('drop');
const photoInput = document.getElementById('photo');
drop.onclick = () => photoInput.click();
drop.addEventListener('dragover', e => { e.preventDefault(); drop.style.background='#eef'; });
drop.addEventListener('dragleave', e => { e.preventDefault(); drop.style.background=''; });
drop.addEventListener('drop', e => {
e.preventDefault();
drop.style.background='';
const file = e.dataTransfer.files[0];
upload(file);
});
photoInput.addEventListener('change', () => upload(photoInput.files[0]));
async function upload(file) {
// 1️⃣ Send file to PHP, which will forward it to Flask
const form = new FormData();
form.append('photo', file);
const res = await fetch('/api/upload_photo', { // <-- PHP endpoint
method: 'POST',
body: form
});
const json = await res.json();
console.log('Uploaded:', json);
}
</script>