我收到错误文件名C:\xamp\tmp\php308F.tmp不可读。
如何解决此问题。为什么会出现这种错误?。
App::import('Vendor','excel_reader2');
public function upload(){
if($this->request->is('post')){
$data = new Spreadsheet_Excel_Reader($_FILES['fileexcel']['tmp_name']);
$row_data = $data->rowcount($sheet_index=0);
$row = 0;
$gagal = 0;
for ($i=2; $i<=$row_data; $i++)
{
$data1 = $data->val($i,1);
$data2 = $data->val($i,2);
$data3 = $data->val($i,3);
$data4 = $data->val($i,4);
$data5 = $data->val($i,5);
$data6 = '0';
$data7 = '0';
$data8 = '0';
$data9 = '0';
$res=$this->Item->find('all', array(
'conditions' => array('Item.item_name' => $data1)));
if(count($res) == '0'){
$rs = $this->Item->find('first', array(
'fields' => array(
'Max(Item.no) as no'
)
));
$max = $rs['0']['no'];
$maxnumber = $max + 1;
$barcode = rand('1111111', '9999999') . str_pad($maxnumber, 5, "0", STR_PAD_LEFT);
$obj= new GetDate();
$date_enter=$obj->getdate();
$this->Item->query("Insert into item (item_name,item_brand,item_price,item_tax,item_quantity,date_enter,item_barcode,BLR,MUM,WEB,EXB,no) values('$data1','$data2','$data3','$data4','$data5','$date_enter','$barcode','$data6','$data7','$data8','$data9','$maxnumber')");
}
}
$this->redirect(array('Controller' => 'Item' , 'action' => 'index'));
}
}