Внутренний экспресс-сервер ng2-file-upload возвращает ошибку 500 - PullRequest
0 голосов
/ 29 января 2019

На ng2-file-upload посылке, когда я звоню uploader.uploadAll(); Я получил 500 ответов от внутреннего экспресс-сервера ng2-file-upload:

TypeError: Cannot read property 'toLowerCase' of null
    at Route._handles_method (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/route.js:63:21)
    at next (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:244:30)
    at expressInit (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/middleware/init.js:40:5)
    at Layer.handle [as handle_request] (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:317:13)
    at /home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:335:12)
    at next (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:275:10)
    at query (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/middleware/query.js:45:5)
    at Layer.handle [as handle_request] (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/layer.js:95:5)
    at trim_prefix (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:317:13)
    at /home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:284:7
    at Function.process_params (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:335:12)
    at next (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:275:10)
    at Function.handle (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/router/index.js:174:3)
    at Function.handle (/home/idea/Development/HisasOnline/web-app/node_modules/express/lib/application.js:174:10)

объект опций:

 uploadOptions: FileUploaderOptions = { url: 'https://localhost:4200/api/course/document', method: 'patch' };

1 Ответ

0 голосов
/ 30 января 2019

Метод PATCH не поддерживается, поэтому вы получили эту ошибку, вместо этого используйте POST

...