• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
extension filename cant show

#1
[eluser]Unknown[/eluser]
dear all..
i'm trying to get filename with extension..but it cant show..
where's the problem..
here's my code
Code:
$bin = rand(00,99);
$kode = 60;
$namabaru=$bin.$kode;
$config['file_name']=$namabaru;
$config['upload_path'] = 'uploads/usulan';
$config['allowed_types'] = 'doc|docx|xls|xlsx';
$this->load->library('upload', $config);
$result = $this->upload->data();
foreach ($result as $item => $value){
     $filename = $result['file_name'];
     $ext = $result['file_ext'];

if ( ! $this->upload->do_upload()) {
echo $this->upload->display_errors();
}
else{
echo $filename.$ext;
}
with this code, the result is only filename without extension. and if i type
Code:
echo $ext;
theres only empty screen..

#2
[eluser]slowgary[/eluser]
This is an old post, but for anyone stumbling on it... my guess here is that $this->upload->data() doesn't contain any information until AFTER the call to $this->upload->do_upload().


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.