Answer the question
In order to leave comments, you need to log in
How to setup node.js environment for jquery.fileupload?
How should I set up the node.js environment for jquery.fileupload?
I'm working with gulp, I tried to install blueimp-file-upload-node, then run it with ./node_modules/blueimp-file-upload-node/server.js, but it didn't work. Nothing happens after launch.
Tried both with gallop on and off.
When uploading a file, it gives an error 404.
I took the information from here - https://github.com/blueimp/jQuery-File-Upload/wiki...
Plugin initialization:
$(function () {
$("input[type=file]").fileupload({
url: "http://localhost:3000",
dataType: "json",
done: function (e, data) {
$.each(data.result.files, function (index, file) {
$("<p/>").text(file.name).appendTo(document.body);
});
}
});
});
Answer the question
In order to leave comments, you need to log in
the nodejs environment and this front-end plugin are not connected in any way, after selecting a file, the download starts automatically, and the request flies to the backend at the address / (root), 404 because it is not processed (caught)
in your backend, configure routes on the backend if express, something like this
app.post('/', (req, res, next) => {
// ловим данные, загружаем файл (сохраняем на диск)
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question