added test case for viewing img upload
This commit is contained in:
parent
5ae2d4236c
commit
7de0cead94
|
@ -55,6 +55,14 @@ uploadButton.addEventListener('click', () => {
|
||||||
// Send the formData to the server using fetch or XMLHttpRequest
|
// Send the formData to the server using fetch or XMLHttpRequest
|
||||||
// ...
|
// ...
|
||||||
console.log('Uploading file:', selectedFile.name);
|
console.log('Uploading file:', selectedFile.name);
|
||||||
|
|
||||||
|
|
||||||
|
//THIS IS A TEST CASE TO MAKE SURE IMG IS BEING UPLOADED PROPER, NEED TO CONFIG SENDING TO SERVER!
|
||||||
|
// Open the uploaded PNG image in a new tab
|
||||||
|
if (selectedFile.type === 'image/png') {
|
||||||
|
const imageUrl = URL.createObjectURL(selectedFile);
|
||||||
|
window.open(imageUrl, '_blank');
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
alert('Please select a file to upload.');
|
alert('Please select a file to upload.');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue