You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My schema is
var NewsItemSchema = new Schema({
title: {type: String, required: true},
date: {type: Date, required: true, default: new Date()},
subtitle: {type: String, required: false},
images: {type: Schema.Types.File, upload_to: __dirname + '/../public/uploads/'},
text:{type: String, required: true},
state:{type: String, enum: ['current', 'archive', 'draft', 'personal']}
});
but nothing happens, in browser's POST request is no field containing my file. In Webstorm debugger i can't see that FileField pre_precess function works, but nothing happens. my App.js:
'use strict';
var mongoose = require('./models/mongoose').mongoose;
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var log = require('./libs/log')(module);
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var passport = require('passport');
var config = require('./libs/config');
var session = require('express-session');
var methodOverride = require('method-override');
var multer = require('multer');
var MongoStore = require('connect-mongo')(session);
My schema is
var NewsItemSchema = new Schema({
title: {type: String, required: true},
date: {type: Date, required: true, default: new Date()},
subtitle: {type: String, required: false},
images: {type: Schema.Types.File, upload_to: __dirname + '/../public/uploads/'},
text:{type: String, required: true},
state:{type: String, enum: ['current', 'archive', 'draft', 'personal']}
});
but nothing happens, in browser's POST request is no field containing my file. In Webstorm debugger i can't see that FileField pre_precess function works, but nothing happens. my App.js:
'use strict';
var mongoose = require('./models/mongoose').mongoose;
var express = require('express');
var path = require('path');
var favicon = require('serve-favicon');
var logger = require('morgan');
var log = require('./libs/log')(module);
var cookieParser = require('cookie-parser');
var bodyParser = require('body-parser');
var passport = require('passport');
var config = require('./libs/config');
var session = require('express-session');
var methodOverride = require('method-override');
var multer = require('multer');
var MongoStore = require('connect-mongo')(session);
require('./libs/passport.js');
var app = express();
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(favicon(__dirname + '/public/favicon.ico'));
app.use(logger('dev'));
app.use(cookieParser());
app.use(methodOverride());
app.use(bodyParser.json());
app.use(multer({ dest: __dirname + '/private/uploads/'}));
app.use(bodyParser.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));
var formage = require('formage').init(app, express, mongoose.models, {
title: 'Экономическая олимпиада имени Кондратьева',
root: '/formage',
default_section: 'main',
admin_users_gui: true
});
app.use(session({
secret: "hidden",
proxy: true,
resave: true,
saveUninitialized: true,
store:new MongoStore({db: 'kondrat-olymp'})
}));
app.use(passport.initialize());
app.use(passport.session());
and forage can't find socket.io.js, i've added it manually but it can't establish connection
The text was updated successfully, but these errors were encountered: