upload file
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
$(document).ready(function () {
|
||||
axios.defaults.baseURL = "http://localhost/Game-Jaming";
|
||||
|
||||
$("#uploadFile").submit(function (e) {
|
||||
let URL = "/Backend/Controllers/FileHandler/upload.php";
|
||||
|
||||
const params = new URLSearchParams();
|
||||
params.append("submitUpload", document.getElementById("indsend1").value);
|
||||
params.append(
|
||||
"gameJamId",
|
||||
document.getElementById("datalistOptions").value
|
||||
);
|
||||
params.append("gameTitle", document.getElementById("Text1").value);
|
||||
params.append("description", document.getElementById("Text2").value);
|
||||
params.append("gameFile", document.getElementById("formFile1").value);
|
||||
params.append("thumbnailFile", document.getElementById("formFile2").value);
|
||||
params.append("isWebBased", document.getElementById("Switch1").checked);
|
||||
|
||||
axios
|
||||
.post(URL, params)
|
||||
.then(function (response) {
|
||||
console.log(response);
|
||||
})
|
||||
.catch(function (error) {
|
||||
console.log(error);
|
||||
});
|
||||
e.preventDefault();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user