help convert php to codeingter |
[eluser]runrun[/eluser]
Hi guys, I am trying to integrate an upload to my website You can find the full demo of the upload here http://valums.com/ajax-upload/ Now, the author didn't provide a codeigniter snippet server side, but he did give a php class, which I failed to convert to codeigniter. I wonder if you please translate the code to codeigniter functions ? Code: <?php I just need to know how to grab the uploading file in codeigniter
[eluser]Danes[/eluser]
Hi runrun, This is my quick attempt at your request. It worked for me, although I'm sure it's not the tidiest way to handle it and organize the code. I created a controller controllers/uploadcontroller.php and included the code you provided, keeping the classes defined there. Then modified the last part to define the controller class as shown here: Code: <?php Note that to use this you will need to enable query strings as explained here. On the client side, when creating the upload control, change the action to post to your new upload controller like this: Code: var uploader = new qq.FileUploader({ As said, no doubt the code should be separated to different files and included, perhaps, as a library, but this is a quick fix. Hope it helps. Regards |
Welcome Guest, Not a member yet? Register Sign In |