The browser reported an error while uploading the image
1. PUT.................... 503 (Service Unavailable) cfs_upload-http.js
2.Error: "Queue" failed [503] Error in method "/cfs/files/:value/:value/",
Error: MongoError: Mod on _id not allowed at Function.MongoError.create (/usr/operater/.meteor/packages/npm-mon... [undefined],
Error: failed [503] Error in method "/cfs/files/:value/:value/",
Error: MongoError: Mod on _id not allowed at Function.MongoError.create (/usr/operater/.meteor/packages/npm-mon...
[undefined]
at cfs_upload-http.js?hash=306e43cc9d8394be78a109ac76d47adb40af9e27:382
at cfs_upload-http.js?hash=306e43cc9d8394be78a109ac76d47adb40af9e27:108
at underscore.js?hash=884c0f04552531e604be5ca6d94381bbf1550f5c:794
at XMLHttpRequest.xhr.onreadystatechange (cfs_upload-http.js?hash=306e43cc9d8394be78a109ac76d47adb40af9e27:231)
The following error occurred after clicking the splicing url of the uploaded image in the browser console:
1. Error in method "/cfs/files/:value/:value/:value/", Error: TypeError: Cannot read property 'images-original' of undefined
2. at Object.httpGetHandler (packages/cfs_access-point.js:380:33)
3. at Object.get (packages/cfs_access-point.js:698:39)
4. at packages/cfs_http-methods.js:604:33
I get this when I run the app:
I20180606-10:55:52.828(8)? images-original FileSystem mounted on: /testimages/pic
I20180606-10:55:52.905(8)? FS.HTTP.unmount:
I20180606-10:55:52.906(8)? {}
I20180606-10:55:52.906(8)? Registered HTTP method URLs:
I20180606-10:55:52.907(8)? /cfs/files/:collectionName/:id/:filename
I20180606-10:55:52.907(8)? /cfs/files/:collectionName/:id
I20180606-10:55:52.907(8)? /cfs/files/:collectionName
I20180606-10:55:52.913(8)? Server up
=> Meteor server restarted
FS.debug Print log:
I20180606-10:22:22.803(8)? token: eyJhdXRoVG9rZW4iOiJCUmlFRDFtd1ZXYjh6R1hadnRUNmktTVFVMXlTNjZMUG1ITEVEVi1kVVVjIn0=
I20180606-10:22:22.808(8)? HTTP PUT (update) handler received chunk: 0
I20180606-10:22:22.808(8)? GET FILERECORD: S5ZdbMAp5XGA75xdc
I20180606-10:22:22.810(8)? _tempstore FileSystem mounted on: /usr/operater/testApp/testOne/.meteor/local/cfs/files/_tempstore
I20180606-10:22:22.810(8)? TempStore is mounted on storage.filesystem
I20180606-10:22:23.245(8)? token: eyJhdXRoVG9rZW4iOiJCUmlFRDFtd1ZXYjh6R1hadnRUNmktTVFVMXlTNjZMUG1ITEVEVi1kVVVjIn0=
I20180606-10:22:23.248(8)? HTTP PUT (update) handler received chunk: 0
I20180606-10:22:23.249(8)? GET FILERECORD: S5ZdbMAp5XGA75xdc
I20180606-10:22:23.324(8)? token: eyJhdXRoVG9rZW4iOiJCUmlFRDFtd1ZXYjh6R1hadnRUNmktTVFVMXlTNjZMUG1ITEVEVi1kVVVjIn0=
I20180606-10:22:23.328(8)? HTTP PUT (update) handler received chunk: 0
I20180606-10:22:23.328(8)? GET FILERECORD: S5ZdbMAp5XGA75xdc
I20180606-10:22:23.372(8)? token: eyJhdXRoVG9rZW4iOiJCUmlFRDFtd1ZXYjh6R1hadnRUNmktTVFVMXlTNjZMUG1ITEVEVi1kVVVjIn0=
I20180606-10:22:23.375(8)? HTTP PUT (update) handler received chunk: 0
I20180606-10:22:23.375(8)? GET FILERECORD: S5ZdbMAp5XGA75xdc
I20180606-10:22:23.438(8)? token: eyJhdXRoVG9rZW4iOiJCUmlFRDFtd1ZXYjh6R1hadnRUNmktTVFVMXlTNjZMUG1ITEVEVi1kVVVjIn0=
I20180606-10:22:23.441(8)? HTTP PUT (update) handler received chunk: 0
I20180606-10:22:23.442(8)? GET FILERECORD: S5ZdbMAp5XGA75xdc
It seems the upload is interrupted
Here's my code
in cilent/main.js:
Template.mytemplate.events({
'change #uploadfile': function(event, template) {
idCardImgInsert();
},
'click #idcards': function(event) {
console.log(Session.get('imgId'));
return alert('##');
},
})
function idCardImgInsert() {
var idCardImageUrl = '';
var idCardImg = new FS.File($('#uploadfile').get(0).files[0]);
console.log('idCardImg', idCardImg);
if (idCardImg) {
var idCardImgObj = Images.insert(idCardImg, function(err, result) {
if (err) console.log(err);
console.log(result);
});
if (idCardImgObj.original.name) {
idCardImageUrl = "http://103.231.255.47:8090/cfs/files/" +
idCardImgObj.collectionName +
"/" + idCardImgObj._id + "/" + idCardImgObj.original.name;
idCardImageId = idCardImgObj._id;
console.log(idCardImgObj);
console.log(idCardImageUrl);
idCardImgObj.url({
brokenIsFine: true
});
Session.set("imgId", idCardImgObj._id);
console.log('imgId', idCardImgObj._id);
}
}
var idCardUrl = {
idCardImageUrl: idCardImageUrl,
}
return idCardUrl;
}
FS.HTTP.setBaseUrl('/cfs');
Hello, everyone!
I encountered a problem when using collectionFS
The browser reported an error while uploading the image
The following error occurred after clicking the splicing url of the uploaded image in the browser console:
I get this when I run the app:
FS.debug
Print log:It seems the upload is interrupted
Here's my code
in cilent/main.js:
in lib/images.js:
in server/server.js:
packags:
meteor version:1.6.1 mongodb version:2.4.9
What's wrong with the configuration? please help me!!!!