This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const path = require('path'); | |
const formidable = require('formidable'); | |
const fs = require('fs'); | |
const app = express(); | |
const port = 3000; | |
// configure middleware | |
app.set('port', process.env.port || port); // set express to use this port | |
app.set('views', __dirname + '/views'); // set express to look in this folder to render our view |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
app.get('/', open_index_page);//call for main index page | |
function open_index_page(req, res, next){ | |
if(req.method == "GET"){ | |
res.render('index.ejs'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Upload File Tutorial</title> | |
</head> | |
<body> | |
<div class="container col-sm-12" id="choose-files" oncopy="return false" oncut="return false" onpaste="return false"> | |
<div class="row"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const formidable = require('formidable'); | |
const fs = require('fs'); | |
//upload file api | |
app.post('/uploadfile',upload_file); | |
function upload_file(req, res, next){ | |
if(req.method == "POST") { | |
// create an incoming form object |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyParser = require('body-parser'); | |
const path = require('path'); | |
const app = express(); | |
const port = 3000; | |
// configure middleware | |
app.set('port', process.env.port || port); // set express to use this port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.gradle | |
/local.properties | |
/.idea/workspace.xml | |
.DS_Store |