Valums Ajax Upload with Codeigniter: Get Parameters! Valums Ajax Upload with Codeigniter: Get Parameters! codeigniter codeigniter

Valums Ajax Upload with Codeigniter: Get Parameters!


With Valums the parameters are set like so:

var uploader = new qq.FileUploader({    element: document.getElementById('file-uploader'),    action: '/server-side.upload',    // additional data to send, name-value pairs    params: {        param1: 'value1',        param2: 'value2'    }});

or using

uploader.setParams({   anotherParam: 'value' });

if you want it to be aware of the state of your app/

subD="/Pic"function selectGaleryName(){subD=subD+"/3"alert(subD) // /Pic/3}var uploader = new qq.FileUploader({element: document.getElementById('UploadFile'),action: 'http://localhost/Farainform/manager/upload.php'// additional data to send, name-value pairsonComplete: function(id, fileName, responseJSON){ selectGaleryName();uploader.setParams({  subDirectory : subD});},});

if you want to set an id and a description for an image you can set these in javascript and then send these. So something like (im using jQuery here):

var description = $('#input_description').val(); //This can be an input var id = $('#input_description').att('id');var uploader = new qq.FileUploader({    element: document.getElementById('file-uploader'),    action: '/server-side.upload',    // additional data to send, name-value pairs    params: {        description: description,        id: id    }});

Note I havent tested this code and its for demonstration purposes.


$_GET was always destroyed in the 1.7.3 branch but upgrade to the new CodeIgniter Reactor 2.0 and you'll find that GET strings work out of the box.

When upgraded, use this syntax:

$this->input->get('value1');


I don't know why it is not documented on Valums page, but apparently parameters should be sent not like this

params: {        param1: 'value1',        param2: 'value2'}

But like this

data: {param1: 'value1',       param2: 'value2'}

On server side you could get them with $_REQUEST['param1'];