MojitoProxy - File upload


I'm looking to MojitProxy Invoke method: http://developer.yahoo.com/cocktails/mojito/api/classes/MojitProxy.html#method_invoke

And I have noticed that I can send a file as params, I'm wondering if I can use this functionality to upload files through passing the file to params.file variable, and handeling that on the server side by calling MojitProxy.invoke function.

Is it possible to do that? if so, can you please give a guidance?


2 Replies
  • Hi,

    I'm note sure it works that way. file is a map of key/value pair,not sure values are file. And if you look at the params actioncontext addon, you can notice the file params does not look so usable, as you will get an empty object.


    I'm a bit confused about those params in the invoke functions, what do they correspond to?

    Anyway it is still worth to try it, and wait for a bartender's answer! Have fun!

  • No, invoke is the API to execute an action from a binder, it just happens to rely on rpc call to a server if the mojit to be invoked is not in the page and can't be deployed to the client side. In other words, you should not use invoke to communicate with a middleware, which is what you normally use to upload files into an express application. The reason why you should not do it is mostly because there are limitations in the data you can send but mostly because we control that rpc mechanism, and we might change it in the near future since it is an internal api.


Recent Posts

in Yahoo! Mojito