prasathmani / tinyfilemanager

Single-file PHP file manager, browser and manage your files efficiently and easily with tinyfilemanager
https://tinyfilemanager.github.io
GNU General Public License v3.0
4.63k stars 1.63k forks source link

Zip Compressing multiple files does not work #645

Open luisalvarado opened 2 years ago

luisalvarado commented 2 years ago

Tried to compress 8 files and it failed (Total file size was 2 MB). Tried to compress one and it failed too. The context menu would also be a great idea where you right click a file or a group of selected files and it shows you the option to compress.

sharon846 commented 2 years ago

I don’t know if it is related, but since the update to php 8.0, zip compression method via php has changed, check it out :)

michael-milette commented 2 years ago

@luisalvarado,

Here are a few things you can check:

  1. Does your webserver have write permission to the directory in which the files are located?
  2. As your file is pretty small, this might not be it but How long does it take before it fails? If it is more than 30 seconds, you may need to increase the PHP timeout in your php.ini file. Alternatively, @prasathmani might want to consider increasing the timeout programmatically.
  3. What are the names of the files you are trying to ZIP and what is the name of the directory in which they are located? The files may include characters that ZIP does not support. Try renaming your files if they contain anything but letters a-z. Does this happen with *.txt files?

@srworkspace

The ZIP feature will not work for you. The function zip_open() is deprecated in PHP 8.x in favor of the Object API, see ZipArchive::open().

@prasathmani , this and all references to zip_* functions will need to be fixed in order to make this feature PHP 8 compatible. Fortunately, the solution is backward compatible to PHP 5.2: https://github.com/prasathmani/tinyfilemanager/blob/master/tinyfilemanager.php#L2599

Best regards,

Michael Milette

luisalvarado commented 2 years ago
  1. Yes. For folder, parent folder and files. Full 0777 permission even.
  2. No. It is less than 5 seconds.
  3. Clean standardized names like photo.zip and inside photo01.jpg all the way till photo10.jpg for example.

It is nothing related to the system since it was the first thing developers check.