added more functionality to the shadowbox part of the profile page
This commit is contained in:
22
Profile Page/scripts.js
Normal file
22
Profile Page/scripts.js
Normal file
@@ -0,0 +1,22 @@
|
||||
function uploadShadowbox() {
|
||||
const shadowboxInput = document.querySelector('input[name="shadowboxInput"]');
|
||||
shadowboxInput.click();
|
||||
}
|
||||
|
||||
//lol I have no idea what this does its an HTTP POST request thats all I know
|
||||
function handleShadowboxUpload(input) {
|
||||
const file = input.files[0];
|
||||
const formData = new FormData();
|
||||
formData.append('shadowboxFile', file);
|
||||
|
||||
const xhr = new XMLHttpRequest();
|
||||
xhr.open('POST', '/uploadShadowbox');
|
||||
xhr.onload = function () {
|
||||
if (xhr.status === 200) {
|
||||
console.log('File uploaded successfully');
|
||||
} else {
|
||||
console.error('Error uploading file');
|
||||
}
|
||||
};
|
||||
xhr.send(formData);
|
||||
}
|
||||
Reference in New Issue
Block a user