node-ddp-client
node-ddp-client copied to clipboard
DDP client with file upload is showing error
I am trying to upload file through ddp client connection. In that iam download a packages from node-ddp-client .connections and send and retrive text message is working fine. But iam trying to upload a file with options like
{
"msg": "method",
"method": "slingshot/uploadRequest",
"id": "42",
"params": [
"rocketchat-uploads",
{
"name": _"https://domain.com/aws_logo._V400518270_.png",
"size": 15664,
"type": "image/png"
},
{ "rid": "room-id" }
]
}
I am calling functions like
ddpclient.call(
"slingshot/uploadRequest",
[
"rocketchat-uploads",
{
"name": "https://domain.com/aws_logo._V400518270_.png",
"size": 430.8,
"type": "image/png"
},
{ "rid": "GENERAL" }
],function(err,result){
console.log(err);
console.log(result);
},function(ucb){
console.log("ucb");
});
in client side shows the error
{ error: 'Invalid directive',
reason: 'The directive rocketchat-uploads does not seem to exist',
message: 'The directive rocketchat-uploads does not seem to exist [Invalid directive]',
errorType: 'Meteor.Error' }
What is the problem and where i change my code. ? Please help...!!!