orioltestart Posted August 11, 2016 Share Posted August 11, 2016 Hi people, I hope you could help me, I need to upload a file (xml) and process it with a module. I've been trying to use the HelperForm creating the form like this: public function renderForm() { $default_lang = (int)Configuration::get('PS_LANG_DEFAULT'); $fields_form[0]['form'] = array( 'legend' => array( 'title' => $this->l('Importar Productos'), 'image' => '../img/admin/cog.gif' ), 'input' => array( array( 'type' => 'file', 'name' => 'my-name', 'multiple' => false, 'label' => $this->l('Elija un archivo de importacion'), 'lang' => true, 'id' => 'my-name' ) ), 'submit' => array( 'title' => $this->l('Guardar'), 'class' => 'button' ) ); $token=Tools::getAdminToken($this->className.intval(Tab::getIdFromClassName($this->className)).intval($this->context->cookie->id_employee)); $helper = new HelperForm(); $helper->module = $this; $helper->name_controller = $this->name; $helper->token = $token; $helper->currentIndex = AdminController::$currentIndex.'&configure='.$this->name; $helper->languages = Language::getLanguages(); $helper->default_form_language = $default_lang; $helper->allow_employee_form_lang = $default_lang; $helper->submit_action = 'submit'.$this->name; // $helper->fields_value['BETTERPRICE_EMAIL'] = Configuration::get('BETTERPRICE_EMAIL'); return $helper->generateForm($fields_form); } After that I render that form on the template. The question is: where does the file go after the upload? It goes on a controller method? I've tried to override processAdd() and processUpload() with d("HELLO"); and non of those executes that. I have serious doubts about what method executes and when does it on the controller or in the module.php or what where should locate the action of the form -> how does i set the href (on BO the url goes different, what parameters are required..) Hope somebody could help me, Thanks! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now