i already tried to use but not working.
view/upload.php :
[removed]
$(document).ready(function(){
$("#upload").uploadify({
uploader: '<?php echo base_url();?>assets/uploadify/uploadify.swf',
script: '<?php echo base_url();?>assets/uploadify/uploadify.php',
cancelImg: '<?php echo base_url();?>assets/uploadify/cancel.png',
folder: '../../assets/upload',
scriptAccess: 'always',
multi: false,
'onError' : function (a, b, c, d) {
if (d.status == 404)
alert('Could not find upload script.');
else if (d.type === "HTTP")
alert('error '+d.type+": "+d.status);
else if (d.type ==="File Size")
alert(c.name+' '+d.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB');
else
alert('error '+d.type+": "+d.text);
},
'onComplete' : function (event, queueID, fileObj, response, data) {
$.post('<?php echo site_url('asset/uploadify');?>', {filearray: response}, function(info) {
$("#target").append(info);
});
//var json_data_object = eval("(" + response + ")");
//filename = json_data_object.file_name;
//[removed].replace('<?php echo site_url('asset/step3');?>/'+filename);
}
});
//function onCompletePost(data) {
//alert("test");
//[removed] = "<?php echo site_url('asset/uploadify'); ?>";
//}
});
[removed]
<div class="content">
<h1><?= $title; ?></h1>
<?php echo form_open_multipart('asset/uploadify');?>
<div class="data">
<div class="step1">
<span class="head-step1">Step 2 : Upload your zip file : </span>
<table>
<tr>
<td>File</td>
<td>
<?php echo form_upload(array('name' => 'Filedata', 'id' => 'upload'));?>
</td>
</tr>
<tr>
<td> </td>
<td>
<a href="[removed]$('#upload').uploadifyUpload();">Upload</a>
</td>
</tr>
</table>
<div id='target'>
</div>
</div>
</div>
<?php echo form_close(); ?>
<br />
<?= $link_back; ?>
</div>
controller/upload.php
function uploadify() {
$data['response'] = json_decode($this->input->post('filearray'));
//Access data using php json object
$data['file_name'] = $data['response']->file_name;
// $data['file_size'] = $data['response']->file_size;
//$data['file_type'] = $data['response']->file_type;
//$data['file_ext'] = $data['response']->file_ext;
//print_r($data);
$this->load->library('unzip');
$config['fileName'] = base_url().'assets/upload/'.$data['file_name'];
$config['targetDir'] = base_url().'assets/upload/';
$this->unzip->initialize($config);
if(!$this->unzip->unzipAll()) {
print_r($this->unzip->display_errors(1));
$this->unzip->close();
}
// if(!$this->unzip($data['file_name'])) {
// print_r('not ok');
// }
else {
echo $data['file_name'];
$this->unzip->close();
}
}
it come out these error :
//a lot of this
Severity: Warning
Message: fseek() [function.fseek]: stream does not support seeking
Filename: libraries/unzip.php
Line Number: 459
//and these two :
dUnzip2: Loading list from 'End of Central Dir' index list...
dUnzip2: ZIP File is corrupted or empty
can anybody help me?