⚠ 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

callback_after_upload : get name of the field clicked



Pablo Uribe
  • profile picture
  • Member

Posted 07 July 2016 - 05:53 AM

HI MASTERS, please help

 

one table have 2 columns : A and B

 

both save files 

 

$crud->set_field_upload('A', 'public/uploads/files');
$crud->set_field_upload('B', 'public/uploads/files');
 
 
$crud->callback_after_upload(array($this, '_callback_upload')); is fired when i pick one file.
 
i need to know what field is firing the callback, because i need to apply several validations depending if it A or B
 
THANK YOU VERY MUCH 
 

 


Amit Shah
  • profile picture
  • Member

Posted 07 July 2016 - 06:16 AM

Hi Pablo,

 

If you look into the background process, what you will notice is value of the field being populated .. thats coming in. Waht you can do in i - look@the actual name of the file and value in the field .. see which one is same - that is probably the file being uploaded. Now only issue in this case is - if the user is trying to upload same file for both the fields - it may be causing the problem / issue. But thats just - rare condition / situation.

 

Till then, hope this technique helps you look in helping reach your solution you looking into.

 

Happy Gcing..


Pablo Uribe
  • profile picture
  • Member

Posted 07 July 2016 - 15:10 PM

thank you, the problem was solved !!