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 multer = require('multer'); | |
const storageConfiguration = multer.diskStorage({ | |
destination: (req, file, callback) => { | |
callback(null, `${__dirname}/upload`); | |
}, |
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 storageConfiguration = multer.diskStorage({ | |
destination: (req, file, callback) => { | |
callback(null, `${__dirname}/upload`); | |
}, | |
filename: (req, file, callback) => { | |
let name = `ourFile${path.extname(file.originalname)}`; | |
callback(null, name); | |
} | |
}); |
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 multer = require('multer'); | |
const app = express(); | |
app.get('/api', (req, res) => { | |
res.send('Welcome to our upload server. Have a nice ride') | |
}); |
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
import React, {Component} from 'react'; | |
import axios from 'axios'; | |
import logo from './logo.svg'; | |
import './App.css'; | |
class App extends Component { | |
constructor(props){ | |
super(props); | |
this.state = { file: '' } | |
} |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>React Example</title> | |
</head> | |
<body> | |
<div id='react-container'></div> | |
<script src='https://unpkg.com/[email protected]/dist/react.js' type="text/javascript"></script> | |
<script src='https://unpkg.com/[email protected]/dist/react-dom.js' type="text/javascript"></script> | |
<script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>React Example</title> | |
</head> | |
<body> | |
<div id='react-container'></div> | |
<script src='https://unpkg.com/[email protected]/dist/react.js' type="text/javascript"></script> | |
<script src='https://unpkg.com/[email protected]/dist/react-dom.js' type="text/javascript"></script> | |
<script> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Provision</title> | |
</head> | |
<body> | |
<div id='react-container'></div> | |
<!-- We import the React and ReactDOM library --> | |
<script src='https://unpkg.com/[email protected]/dist/react.js' type="text/javascript"></script> | |
<script src='https://unpkg.com/[email protected]/dist/react-dom.js' type="text/javascript"></script> |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>React Tutorials</title> | |
</head> | |
<body> | |
<!-- Target Container --> | |
<div id="react-container"></div> |