⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

get primary key in handle_file_upload library



anilp78
  • profile picture
  • Member

Posted 23 September 2016 - 20:17 PM

Hi !

I am trying to concatenate primary key of the record as prefix to the filename to be uploaded. I was trying to get the primary key in the handle_file_upload function in the library and then concatenate it in the line

 

$file->name = $this->trim_file_name($name, $type);

 

so it becomes something like this -

 

$file->name = get_primary_key.'-'. $this->trim_file_name($name, $type);

 

However, i dont know how to get the primary key there. Please help, am using the version 1.5.6.

 

thanks,

 

Anil