Skip to content

DDP client with file upload is showing error  #23

@firozcitrus

Description

@firozcitrus

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...!!!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions