From 2b08ef3e0734ebc5d0aad555161afcb324a81e36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacob=20S=C3=B8feldt?= Date: Thu, 29 Apr 2021 11:47:55 +0200 Subject: [PATCH] upload file --- Frontend/Html/newPage.html | 80 +++++++++++++++++++++++++ Frontend/Index.html | 93 ++++++++++++++++++++++++++++++ Frontend/Javascript/UplodeFiles.js | 29 ++++++++++ 3 files changed, 202 insertions(+) create mode 100644 Frontend/Javascript/UplodeFiles.js diff --git a/Frontend/Html/newPage.html b/Frontend/Html/newPage.html index e418d36..bcbba4c 100644 --- a/Frontend/Html/newPage.html +++ b/Frontend/Html/newPage.html @@ -267,6 +267,86 @@ +
+
+
+
+
+ + + + + +
+
+
+
+ + +
+
+
+ +
+ + +
+
+
+
+
+ + +
+
+ + +
+ Thumbnail is optional. +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
diff --git a/Frontend/Index.html b/Frontend/Index.html index 5ebbb88..a426d06 100755 --- a/Frontend/Index.html +++ b/Frontend/Index.html @@ -1073,6 +1073,98 @@ kommentar omkring hvad spillet handler om, for at give spilleren den bedste oplevelse.

+
+
+
+
+
+ + + + + +
+
+
+
+ + +
+
+
+ +
+ + +
+
+
+
+
+ + +
+
+ + +
+ Thumbnail is optional. +
+
+
+
+
+
+ + +
+
+
+
+ +
+
+
@@ -1263,6 +1355,7 @@ + diff --git a/Frontend/Javascript/UplodeFiles.js b/Frontend/Javascript/UplodeFiles.js new file mode 100644 index 0000000..b53b46a --- /dev/null +++ b/Frontend/Javascript/UplodeFiles.js @@ -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(); + }); +});