⚠ 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

Upload in a specific directory



drjonesx
  • profile picture
  • Member

Posted 15 November 2014 - 12:20 PM

Hi

Is there some one that can help me to do that?

 

I need to have an upload that is made in fonction of the product and categorie selected

Example

Category : car
Product : v1.1
files: xxx.exe

the needed upload result is 

../upload/car/v1.1/xxx.exe

 

In advance, thanks for your help

 

PS: i have also Teamviewer if it easyer :-)

 

 

 


Mike
  • profile picture
  • Member

Posted 28 June 2015 - 10:21 AM

Hello, i'm a newbie within this library, but i think you can do it by passing a variable to the set_field_upload method, something like this:

public function employees_management($myvar)
{
		$crud = new grocery_CRUD();

		$crud->set_theme('datatables');
		$crud->set_table('employees');
		$crud->set_relation('officeCode','offices','city');
		$crud->display_as('officeCode','Office City');
		$crud->set_subject('Employee');

		$crud->required_fields('lastName');

		$crud->set_field_upload('file_url','assets/uploads/'. $myvar .'files');

		$output = $crud->render();

		$this->_example_output($output);
}

Greetings!