holgerlembke / ESPxWebFlMgr

Manage your ESP8266/ESP32 SPIFFS/LittleFS files with a simple web based interface
Other
61 stars 14 forks source link

Problem with zip after "download all files" #1

Closed jameszah closed 3 years ago

jameszah commented 3 years ago

Hi - excellent program - thanks.

I'm having a problem with the "download all files" using your basic example on 8266 with LittleFS.

The individual files all download fine, and the zip for "all files" arrives and I can open it will a text editor and see the files there, but with Windows 10 Extract All , and with WINRAR, the files are all created with 0 size and empty. WinRAR reports the correct size on each file -- so I'm guessing a bad crc or zip format ??? WinRAR "repair archive" says it found all the files with 0 size.

I switched your program to ESP32 LittleFS a few weeks ago, and had the same problem.

I copied the example program into the src folder and built it from there using Arduino IDE - is that a problem?

Wondering if you can have a look at these:

image jan11 - Copy.zip

jameszah commented 3 years ago

The crc and file size are correct at the bottom of the file, but there are all zeros in the header for each component file, which Extract All and WinRAR must need.

holgerlembke commented 3 years ago

Well spotted, thanks. Surprisingly it somehow seems to work sometimes for most of us, me including.

Error is a missing flag.

    zipFileHeader zip;
    zip.signature = 0x04034b50;
    zip.versionneeded = 0;
    zip.bitflags = 1 << 3;    // <-------------------------------- flag! Line 577 or so
    zip.comp_method = 0; // stored
    zip.lastModFileTime = 0x4fa5;
    zip.lastModFileDate = 0xe44e;
    zip.extra_field_len = 0;

It will be fixed online asap.