rest library |
[eluser]billmce[/eluser]
I've had some success in getting the Phil Sturgeon rest library working. I'm using the client side to interact with the Alfresco Document Management System. I'm able to authenticate and obtain a ticket. When I use a view such as: Code: <form action="<?php echo $action;?>" method="post" enctype="multipart/form-data" accept-charset="utf-8"> Code: <form action="http://192.168.117.60:8080/alfresco/service/tests/uploadform?alf_ticket=TICKET_8cad96e208752c03142cb3981c53e4325642d51b" method="post" enctype="multipart/form-data" accept-charset="utf-8"> Then all works well. I know I'm passing the uri the authentication ticket required on the server. What I'd like to do however is to have my view/form return to the original controller/method where I can apply some logic, tests etc. and then post the form. What I'd trying to do in my controller is use: Code: $this->rest->post("alfresco/service/tests/uploadform?alf_ticket=" . $ticket, array('name'=>'','file'=>$_POST['file'])); This just hangs ... so I've got something wrong. I don't think I'm passing all the variables required by the server side. The script on the server side may yield a clue to those with more javascript than me (near zero). Code: for each (field in formdata.fields) { What variables does the javascript on the server side require? Am I using the right syntax in the rest library to pass these variables? Thanks in advance.
[eluser]billmce[/eluser]
I think a) this should be a multipart form and b) I've got to pass all the multipart info to the post command somehow (see http://ellislab.com/codeigniter/user-gui...ading.html for $this->upload->data() info). So what do I need to accomplish this? Some code might help you. :-) My controller: Code: <?php And this is the view. Code: <?php Any guidance on how to use the rest library like this ? ... or am I completely off base? Thanks in advance. |
Welcome Guest, Not a member yet? Register Sign In |