Upload to Dynamic Path
- Single Page
Posted 25 May 2012 - 07:13 AM
CUSTB001
Would go to /asset/CUSTB001/Images
So what I am asking is in the controller is there a way I can echo the contents of the id to the file path
Like this:
$crud->set_field_upload('file_url','assets/qa/'echo $custID'/images); //This way does not working but its the easiest way to explain what I am trying to do. I have looked in the library code and tried to figure out how the upload is done but I cant find any information regarding the path.
Any help is greatly appreciated.
Posted 20 June 2012 - 03:33 AM
for instance:
$crud->callback_after_upload(array($this,'_callbackAfterUpload'));
.
....
public function _callbackAfterUpload($uploader_response,$field_info, $files_to_upload)
{
...handle the logic to move the file to its final destination..
return true;
}
Posted 15 March 2013 - 20:21 PM
Hi, the question is... how do i get a field value from a row ($custID, for example) in callbackafterupload method?
Another solution (too complex) is create my own model with an extra calculated field that concats the path and the id: for example: path_image='/img/'.custID.'/portrait'
but the problem is the same... how put this value inside callback method or set_field_upload method?
something similar:
$crud->set_field_upload('file_url',$crud-> column('path_image');
any ideas?
thanks!