Welcome Guest, Not a member yet? Register   Sign In
Need help in file upload
#1

[eluser]Unknown[/eluser]
Hi all,

I am beginner in codigniter.
I am facing problem in uploading the files.

I attaching my code her.

Please let me know where i am doing any wrong.
Code:
$PHOTOPATH=$_SERVER['DOCUMENT_ROOT'].'/resources/store/photo/';
$config = array(
'allowed_types' => 'jpg|jpeg|gif|png',
'upload_path' => $PHOTOPATH.'original/',
'file_name' => time(),
'max_size' => 5242880
);

$this->load->library('upload', $config);

$field_name = "Filedata";

$this->upload->do_upload($field_name);
$eimage = $this->upload->data();
////this end for file upload
//// Now started the file resize code here
  
$evimg = $eimage['file_name'];
$config['source_image'] = $eimage['full_path'];
$config['new_image'] = $PHOTOPATH. '140X100/';
$config['width'] = 140;
$config['height'] = 100;
$config['maintain_ratio'] = true;
$config['master_dim'] = 'width';
$config['create_thumb'] = FALSE;
$this->image_lib->initialize($config);
$this->load->library('image_lib', $config);
$this->image_lib->resize();
//// Now file resize code end here

Any help is best for me.

Waiting any quick response from you guys.

thanks in advance.


Messages In This Thread
Need help in file upload - by El Forum - 12-19-2011, 10:37 PM



Theme © iAndrew 2016 - Forum software by © MyBB