upload images in advanced module assets folder

edited November 2017 in Modules
hello,
i try to upload images in my advanced module assets/images folder.
i put in my newsletter_model :
public function form_fields($values = array(), $related = array()) { $fields = parent::form_fields($values, $related); $fields['Général'] = array('type' => 'fieldset', 'order' => 1, 'class' => 'tab'); $fields['newsletter_numero']['order'] = 2; $fields['uri_newsletter']['order'] = 3; $fields['publication_date']['order'] = 4; $fields['testee']['order'] = 5; $fields['published']['order'] = 6; $fields['Entêtes'] = array('type' => 'fieldset', 'order' => 100, 'class' => 'tab'); $fields['entetes'] = array( 'order' => 101, 'type' => 'template', 'display_label' => FALSE, 'label' => 'Entête', 'add_extra' => FALSE, 'repeatable' => TRUE, 'title_field' => 'entete', 'fields' => array( 'texte' => array( 'type' => 'text', 'label' => 'Texte', ), 'image' => array( 'type' => 'asset', 'label' => 'image', 'folder' => NEWSLETTER_PATH . 'assets/images/', ), ), ); return $fields; }

but when i want upload only app assets are displayed.
assets folder is writable.

Where am i wrong ?
thank you for any idea.

Comments

  • edited 2:47AM
    The "folder" parameter is relative to the main assets/ folder and uploads target that path. So the NEWSLETTER_PATH . 'assets/images/' value won't work. If you want to target a different assets folder entirely for upload, you can try the parameter 'upload_path' instead of 'folder'.
  • edited 2:47AM
    thx for the response.
    yes i am late but since i found a workaround
Sign In or Register to comment.