renaud2263 Posted July 4, 2016 Share Posted July 4, 2016 Dear All, I'm buiding my first BO module in my PS 1.6.1. It allows the admin to uplaod an image and a ZIP file which can be downloaded by customers against their email. My question is about the downloads in BO. Here is a part of code of $fields_form array to buid the form : 'input' => array( array( 'type' => 'file', 'label' => $this->l('Ebook cover'), 'name' => 'BLOCKEBOOK_IMG', 'desc' => $this->l('Upload your image cover.'), 'lang' => true, ), array( 'type' => 'file', 'label' => $this->l('Ebook to download'), 'name' => 'BLOCKEBOOK_ZIP', 'desc' => $this->l('Upload your ZIP file.'), 'lang' => true, ) ) 2 two fields are correctly displayed. Then, in the postProcess function : if ($error = ImageManager::validateUpload($_FILES['BLOCKEBOOK_IMG_'.$lang['id_lang']], 4000000)) { return $this->displayError('Error validate Upload IMG:'.$error); } I suppose this function is controlling if the image is ok. But what is the equivalent one for the ZIP file upload ? Or maybe I can define some variables (size, extension...) directly in the field_form array ? Thanks for your help. 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