News:

Dear forum visitors, if the support forum is not available, please try again a few minutes later. Thanks!

Main Menu
Support-Forum

Error! Not possible to create the zip file on PHP 5.6! - [Fixed in 3.2.42]

Started by Makulia, 12.11.2015 12:27:14

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Makulia

Hello people!

I have faced the same bug that other people had reported before:
Quote"Error! Not possible to create the zip file.
Please contact the Webmaster."

I have read this topics and there were no real solution:
http://www.jdownloads.com/index.php/support-forum.html?topic=7480.0
http://www.jdownloads.com/index.php/support-forum.html?topic=7270.0

I have to debug Jdownloads and have found something interesting:

Warning: ZipArchive::addFile(): Invalid or uninitialized Zip object in /public_html/components/com_jdownloads/helpers/jdownloadshelper.php on line 1964

Warning: ZipArchive::addFile(): Invalid or uninitialized Zip object in /public_html/components/com_jdownloads/helpers/jdownloadshelper.php on line 1964

Warning: ZipArchive::addFile(): Invalid or uninitialized Zip object in /public_html/components/com_jdownloads/helpers/jdownloadshelper.php on line 1964

Warning: ZipArchive::close(): Invalid or uninitialized Zip object in /public_html/components/com_jdownloads/helpers/jdownloadshelper.php on line 1968


Problematic code:
$result = $zip->open($destination, $overwrite ? ZIPARCHIVE::OVERWRITE : ZIPARCHIVE::CREATE);
It works only with php 5.5.x and, maybe, earlier.

My quick fix for this issue for PHP 5.6 is:
$result = $zip->open($destination, ZipArchive::CREATE | ZipArchive::OVERWRITE);





  •  

Arno

Hi Alexander,
many thanks for the hints. Can you give me a link to your source?
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Makulia

Thank you Arno.
I have attached source file.

[gelöscht durch Administrator]
  •  

Arno

Quote from: Makulia on 17.11.2015 20:56:02
Thank you Arno.
I have attached source file.
Thanks for the file but i had meant the information source.
Quote
My quick fix for this issue for PHP 5.6 is:
$result = $zip->open($destination, ZipArchive::CREATE | ZipArchive::OVERWRITE);
I need an info whether this fix works for all php versions.  ::)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Makulia

I have tested fix for php 5.3.x, 5.4.x, 5.5.x, 5.6.x. Works with all versions.
Information source: http://php.net/manual/en/ziparchive.open.php
  •  

Arno

Okay, then i will fix it as you have described.
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •  

Arno

The bugfix is now a part from version 3.2.42 as i had forgotten to implement it in 3.2.41.
Sorry.  ::)
Best Regards / Gruß
Arno
Please make a Donation for jDownloads and/or write a review on the Joomla! Extensions directory!
  •