I have a problem with my app (node js) and file upload. I make e simple form dans while a upload it, my app freeze when i load it in production mode (service with the node package :forever)
But if i run my app with the simple command line : npm start, all work fine.
Here is my code :
div(class='modal fade', id='add')
div.modal-dialog
div.modal-content
form(action='/upload', class='form-upload', enctype='multipart/form-data', method='post')
div.modal-header
button(type='button', class='close', data-dismiss='modal', aria-label='close')
span(aria-hidden='true',) ×
h4
strong Ajouter un média
div.modal-body
.form-group
label(class='control-label') Position
input(type='text', name='order', class='form-control input-lg')
.form-group
label(class='control-label') Nom du fichier
input(type='text', name='name', class='form-control input-lg')
.form-group
label(class='control-label') Délai
input(type='text', name='delay', class='form-control input-lg')
.form-group
label(class='control-label') Fichier
input(type='file', name='upload', class='form-control input-lg')
div.modal-footer
button(type='button', class='btn btn-default', data-dismiss='modal') Fermer
button(type='submit', class='btn btn-primary') Enregistrer
Route :
// POST Upload
router.post('/upload', isAuthenticated, function(req, res)
{
res.send('upload OK');
});
And maybe interesting (user serialize and deserialize)
var login = require('./login');
module.exports = function(passport){
passport.serializeUser(function(user, done) {
console.log("serializing " + user.username);
done(null, user);
});
passport.deserializeUser(function(user, done) {
console.log("deserializing " + user);
done(null, user);
});
login(passport);
}
Here is the log of my APP (it freeze on upload)
serializing raph
^[[0mGET /login/?access_token=123456789
deserializing [object Object]
^[[0mGET /dashboard ^[[32m200 ^[[0m785.797 ms - 7177^[[0m
deserializing [object Object]
^[[0mPOST /upload ^[[32m200 ^[[0m4.801 ms - 4^[[0m
Have someone an idea to hemp me to resolve this problem ?
Aucun commentaire:
Enregistrer un commentaire