I have a problem with jquery ajax's post method.
What trying to doing , When user upload multiple file on sucess upload it to session and save to database , but if im using alert it's correctly working ,
$('#uploader_div').ajaxupload({
url: '<?php echo base_url(); ?>product/multifile',
editFilename: true,
form: '#create',
//autoStart: true,
remotePath: 'product/<?php echo $id; ?>',
thumbHeight: 300,
finish: function(files_array) {
$.post("<?php echo base_url(); ?>product/file_upload", {files: files_array});
//alert ("Workin");
},
//max number of files can be selected
});
Im working on Real ajax uploder in codeigniter
Here is my other part of code
public function multifile() {
$this->load->helper('upload_helper');
}
public function file_upload() {
$data = array();
$id = $this->session->userdata('id');
$files = $this->input->post('files', true);
$i = 1;
foreach ($files as $files) {
$images = "img_" . $i;
$data [$images] = base_url() . "product/" . $id . "/". $files;
$this->session->set_userdata($data);
$i++;
}
}
In view : $this->session->unset_userdata('img_1'); flow of function upload->set session->data save to db -> onsucess removed from session But if i removed the alert the image not comes up it set 0 value , actually my $.post images array not working hope understandable now !