|
 |
|
เรื่อง codeigniter Upload file to database ครับ เนื่องลองทําดูแล้วไม่ได้ครับ |
|
 |
|
|
 |
 |
|
Code (PHP)
$config['upload_path']='./assets/uploads/image_User/';
$config['allowed_types']='jpg';
$config['max_size']='100000';
$name=$_FILES['uploadfile']['name'];
$fileNameParts=explode(".",$name);
$fileExtension=end($fileNameParts);
$fileExtension=strtolower($fileExtension);
$encripted_pic_name=$data['picture_Name'].".".$fileExtension;
$config['file_name']=$encripted_pic_name;
$config['overwrite']=TRUE;
$this->load->library('upload',$config);
if($name!='')
{
if(!$this->upload->do_upload('uploadfile'))
{
echo $this->upload->display_errors();
}
else
{
$data['filename']=$encripted_pic_name;
}
}
ลองดูที่ path ดีๆก่อนนะครับว่าถูกหรือไม่ หากยังไม่ได้ลองเอา code ผมไปลองได้ครับ
|
 |
 |
 |
 |
Date :
2012-08-01 22:50:56 |
By :
benservice |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 00
|