我正在尝试上传文件,我正在使用“Angular File Upload”。尝试连接并将文件发送到 mongodb,但它在 firebug 上出现此错误
净::ERR_INSECURE_RESPONSE
在 mongodb.log 日志文件中,它显示连接已完成:
2014-11-09T11:57:05.512+0400 I NETWORK [initandlisten] 接受来自 xxx.xxx:53749 #2 的连接(现在打开 1 个连接)
2014-11-09T11:57:05.524+0400 I NETWORK [conn2] 结束连接 xxx.xxx:53749(现在打开 0 个连接)
我还创建并使用了 ssl 证书。
我的 Angular Js 代码是:
$scope.onFileSelect = function($files) {
//$files: an array of files selected, each file has name, size, and type.
for (var i = 0; i < $files.length; i++) {
var $file = $files[i];
$upload.upload({
url: "https://localhost:27017/mydb",
file: $file,
progress: function(e){ console.log("Progress: ");}
}).then(function(data, status, headers, config) {
// file is uploaded successfully
console.log("File Uploaded : "+ data);
});
}
};