I have the socketio-file-upload
plugin to upload photos on my server with NodeJS, this work, but when I try to use the plugin functionnalaty to add some data to the upload, the script get stuck.
Client side
var uploader = new SocketIOFileUpload(socket);
uploader.listenOnInput(document.getElementById("upload"));
uploader.addEventListener("start", function(event){
event.file.meta.hello = "world";
});
Sever side
var fileUpload = require("socketio-file-upload");
fileUpload.listen(app);
io.on('connection', function(socket){
var upl = new fileUpload();
upl.dir = "img";
upl.listen(socket);
upl.on("start", function(event){
console.log(event);
});
});
The error comes from the client side where the event argument has no meta object, and when you decide to create one the server side doesn't receive it
The documentation of socketio-file-upload on Adding Meta Data