我正在使用sails.js beta 0.10
文件上传适用于小文件,但对于大文件,它会出现此错误:
error: Server Error:
error: TypeError: Object #<ServerResponse> has no method 'view'
at Object.forbidden (/home/mandeep/iqr/esurvey/api/responses/forbidden.js:81:19)
at ServerResponse.bound [as forbidden] (/home/mandeep/iqr/esurvey/node_modules/lodash/dist/lodash.js:729:21)
at /home/mandeep/iqr/esurvey/node_modules/sails/lib/hooks/csrf/index.js:65:28
at createToken (/home/mandeep/iqr/esurvey/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/csrf.js:82:44)
at /home/mandeep/iqr/esurvey/node_modules/sails/node_modules/express/node_modules/connect/lib/middleware/csrf.js:48:24
at routes.before./* (/home/mandeep/iqr/esurvey/node_modules/sails/lib/hooks/csrf/index.js:62:34)
at routeTargetFnWrapper (/home/mandeep/iqr/esurvey/node_modules/sails/lib/router/bind.js:176:5)
at callbacks (/home/mandeep/iqr/esurvey/node_modules/sails/node_modules/express/lib/router/index.js:164:37)
at param (/home/mandeep/iqr/esurvey/node_modules/sails/node_modules/express/lib/router/index.js:138:11)
at pass (/home/mandeep/iqr/esurvey/node_modules/sails/node_modules/express/lib/router/index.js:145:5) [TypeError: Object #<ServerResponse> has no method 'view']
但是,如果我禁用 csrf,它会完美运行。任何想法 ?