<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Error</title>
</head>
<body>
<pre>TypeError: Cannot read property 'originalname' of undefined<br>
at addObject (/var/www/file.io/app.js:78:11)<br> at /var/www/fi
le.io/app.js:195:2<br> at Layer.handle [as handle_request] (/var/www/f
ile.io/node_modules/express/lib/router/layer.js:95:5)<br> at next (/va
r/www/file.io/node_modules/express/lib/router/route.js:137:13)<br> at
Object.<anonymous> (/var/www/file.io/node_modules/multer/lib/make-middleware.
js:53:37)<br> at Object.immediate._onImmediate (timers.js:381:16)<br>
at processImmediate [as _immediateCallback] (timers.js:363:15)</pre>
</body>
</html>
Last active
February 13, 2018 11:05
-
-
Save srph/15a30519e56041463ad61ffd3f515bb5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
txt |
This file contains hidden or 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 axios = require('axios') | |
const FormData = require('form-data') | |
const fs = require('fs') | |
fs.readFile('f.txt', async function(err, file) { | |
if (err) { | |
console.log('err', err) | |
return | |
} | |
try { | |
const res = await axios.post('https://file.io', { | |
file | |
}) | |
console.log(res.data) | |
} catch(e) { | |
console.log(e.response.status) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment