Skip to content

Commit 3341a44

Browse files
committed
Working
1 parent 480ec83 commit 3341a44

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

run.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fs.mkdirSync("./data/keys")
2929

3030
const requestListener = function (req, res) {
3131
if (req.url!=="/favicon.ico") {
32-
log( String(new Date) + " => " + String(req.url))
32+
log( String(new Date) + ": " + req.method + " => " + String(req.url))
3333

3434
}
3535
if (req.url === "/test"){
@@ -54,16 +54,17 @@ const requestListener = function (req, res) {
5454

5555
data = data.toString().replace("\\\\code2",dc) // error lol
5656
data = data.toString().replace("\\\\code",upc)
57-
log(dc)
58-
log(upc)
57+
//log(dc)
58+
//log(upc)
5959
fs.writeFileSync
6060
res.writeHead(200);
6161
res.end(data);
6262
});
6363
}else if(String(req.url).split("?")[0]==="/upload"){
64-
64+
console.log("upload")
6565
let body = "";
6666
req.on("data",(chunk)=>{
67+
console.log(String(chunk))
6768
body += chunk
6869

6970
})

templates/start.html

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@
2828
<div height = 5%></div>
2929

3030
<input type="text" name="Code" size="15"> <button id = "downb">Download file</button></br>
31-
<form action="/upload">
32-
<input type="file" id="form" name="filename">
33-
<input class = "dum" type="submit">
34-
</form>
35-
31+
<form action="/upload" method="post" enctype="multipart/form-data">
32+
<label for="upload">File:</label>
33+
<input type="file" name="upload" id="upload"><br/>
34+
<input type="submit" name="submit" value="Upload">
35+
</form>
3636
<script src = "start.js"></script>
3737

3838

0 commit comments

Comments
 (0)