我想上传文件,我正在使用“Angular File Upload”。尝试连接并发送文件到MongoDB的,但它给出了Firebug的这个错误如何连接并发送文件到MongoDb角文件上传
网:: ERR_INSECURE_RESPONSE
在mongodb.log日志文件,它显示了连接完成:
2014-11 -09T11:57:05.512 + 0400我NETWORK [initandlisten]从xxx.xxx:53749#2连接接受(1个连接现在打开)
2014-11-09T11:57:05.524 + 0400 i网络[CONN2 ]结束连接xxx.xxx:5 3749(0连接现在打开)
我也创建和使用SSL证书。
我的角度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);
});
}
};