owltheme Posted December 22, 2016 Share Posted December 22, 2016 (edited) prestashop 1.7.0.3 install theme: bug "Invalid file format." http://addons.prestashop.com/upload/585ae998c2cbc.png Please help me. Thank you! Edited December 22, 2016 by owltheme (see edit history) Link to comment Share on other sites More sharing options...
bellini13 Posted December 22, 2016 Share Posted December 22, 2016 does this same theme work on 1.7.0.2? Link to comment Share on other sites More sharing options...
owltheme Posted December 22, 2016 Author Share Posted December 22, 2016 Yes, The theme work on 1.7.0.2 => ok But When install on 1.7.0.3=>bug "Invalid file format" . The theme default Classic => bug. Link to comment Share on other sites More sharing options...
bellini13 Posted December 22, 2016 Share Posted December 22, 2016 yea, looks like they made a change in the AdminThemesController.php They changed this ... $finfo = new finfo(FILEINFO_MIME_TYPE); $ext = array_search( $finfo->file($_FILES['themearchive']['tmp_name']), array( 'zip' => 'application/zip', ), true ); if ($ext === false) { $this->errors[] = $this->trans('Invalid file format.', array(), 'Admin.Design.Notification'); return false; } To this... if ('application/zip' !== $_FILES['themearchive']['type']) { $this->errors[] = $this->trans('Invalid file format.', array(), 'Admin.Design.Notification'); return false; } They are probably trying to remove the dependency on FileInfo extension, and failed to test that the new code would actually work. You could try to revert that code back to the 1.7.0.2 version, but ideally you should create a forge ticket so they are aware of the issue and can fix it in the next release Link to comment Share on other sites More sharing options...
alain.d.cote Posted February 1, 2017 Share Posted February 1, 2017 so any solution to that issue? got the same message when trying to add a theme. Regards Link to comment Share on other sites More sharing options...
alain.d.cote Posted February 1, 2017 Share Posted February 1, 2017 I have change the code as suggested but now prestashop is freesing and othing happen. What is the solution? Link to comment Share on other sites More sharing options...
alain.d.cote Posted February 1, 2017 Share Posted February 1, 2017 Just upgrade to 1.7.0.4, and still not able to add a theme. Now instead to get the "Invalid file format" i get a blank page and freeze. Please a solution is require. Link to comment Share on other sites More sharing options...
Radhanatha Posted April 3, 2017 Share Posted April 3, 2017 The below code work for me in prestashop 1.7.0.3 I havea changed in the AdminThemesController.php They changed this ... $finfo = new finfo(FILEINFO_MIME_TYPE); $ext = array_search( $finfo->file($_FILES['themearchive']['tmp_name']), array( 'zip' => 'application/zip', ), true ); if ($ext === false) { $this->errors[] = $this->trans('Invalid file format.', array(), 'Admin.Design.Notification'); return false; } To this... if ('application/zip' !== $_FILES['themearchive']['type']) { $this->errors[] = $this->trans('Invalid file format.', array(), 'Admin.Design.Notification'); return false; } 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