dannycho7 / express-form-post Goto Github PK
View Code? Open in Web Editor NEWSimple and efficient nodejs http file upload middleware.
Home Page: https://www.npmjs.com/package/express-form-post
License: MIT License
Simple and efficient nodejs http file upload middleware.
Home Page: https://www.npmjs.com/package/express-form-post
License: MIT License
Hi, I'm using your library to upload a file from express backend to Dropbox but the request remains pending. In the file dropbox.js, when the DropboxUploadStream is instantiated, the 'finish' event isn't catched as indicated in the library "Dropbox Stream" (https://github.com/velocityzen/dropbox-stream), but it's catched the 'done' event (never executed).
I've tryed to change 'done' event with 'finish' and now the function req.efp.finished() is called.
Could you check and, if necessary, update the library?
This is the snippet that i'm using:
`var express = require("express");
var app = express();
var efp = require("express-form-post");
const formPost = efp({
store: "dropbox",
filename: function(req, file, cb) {
cb(Date.now() + file.originalname);
},
api: {
accessToken: access_token
},
promise: true
});
app.post("/upload", function(req, res, next) {
formPost.upload(req, res).then(() => {
// add your response statements here
console.log("The uploaded file information is located here:", req.files);
res.status(200).send();
}).catch((err) => {
// add your catch statements here
console.log(err);
})
});
app.listen(3000, () => console.log('Server app listening on port 3000!'));`
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.