File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ fs.mkdirSync("./data/keys")
2929
3030const 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 } )
Original file line number Diff line number Diff line change 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
You can’t perform that action at this time.
0 commit comments