Page 1 of 2

Need help to compress files into ESP32

Posted: Mon Feb 12, 2018 6:19 pm
by Ritesh
Hi,

We are working on ESP32 Modules and SDK for our product development.

Right now, We are using Loboris SPIFFS component to create directory and files for our project requirement.

We have one requirement in which we need to compress files as well folders into single file and push it to cloud or local server as per requirement.

So, does ESP32 supports any inbuilt library or application to compress files and folders into single file? If not then would anyone suggest me to do it in beat feasible way.

In short, we need file and folder compression support for ESP32.

Let me know if need anything else or required more information for our requirements.

Re: Need help to compress files into ESP32

Posted: Tue Feb 13, 2018 3:47 am
by Ritesh
Hi Loboris or Espressif System Developers,

Do you have any update or information regarding this feature? is it possible to do into ESP32 SDK through external component?

Please suggest me best feasible option or solution for that.

Re: Need help to compress files into ESP32

Posted: Wed Feb 14, 2018 6:45 pm
by Ritesh
Hi Loboris or Espressif Developer,

Is there any update regarding this?

Re: Need help to compress files into ESP32

Posted: Wed Feb 14, 2018 8:00 pm
by loboris
As far as I know, there is no folder compression support or library for ESP32.

You could use zlib library to compress the files.
Here is the link to the zlib component I'm using with only the files needed.

There is no function in it to compress the directory, you will need to create your own function to commpress the individual files and the directory info and put them in the final file, same for the decompression.

There is a third party library contrib/minizip in zlib repository which may help with that.

You can also try to port libarchive to ESP32. It contains everything you need, but I haven't try to compile it.

Probably it would be easier to just recursively download all the needed files from the remote server.

Re: Need help to compress files into ESP32

Posted: Thu Feb 15, 2018 4:08 pm
by Ritesh
loboris wrote:As far as I know, there is no folder compression support or library for ESP32.

You could use zlib library to compress the files.
Here is the link to the zlib component I'm using with only the files needed.

There is no function in it to compress the directory, you will need to create your own function to commpress the individual files and the directory info and put them in the final file, same for the decompression.

There is a third party library contrib/minizip in zlib repository which may help with that.

You can also try to port libarchive to ESP32. It contains everything you need, but I haven't try to compile it.

Probably it would be easier to just recursively download all the needed files from the remote server.
Hi Loboris,

Thanks for quick response.

Our requirement is to have few files into few folders which need to compress all together into single zip file and send it to cloud if have external connectivity.

It will be good if you had developed this type of example before using ESP32. So, provide it if you have that type of example

Re: Need help to compress files into ESP32

Posted: Tue Jun 19, 2018 1:05 pm
by snahmad75
Hi,
Have any one manage to uncompress zip in esp32 and extract to folder.
Kindly share your experience.

Thanks,
Naeem

Re: Need help to compress files into ESP32

Posted: Wed Jun 20, 2018 8:36 am
by snahmad75
The third party library contrib/minizip does not build for esp32.

Re: Need help to compress files into ESP32

Posted: Fri Jun 14, 2019 3:04 pm
by snahmad75
I managed to compile/build zlib with minizip.

It works to unzip file.

howver zipper is not working.

I tried this example

http://www.vilipetek.com/2013/11/22/zip ... iles-in-c/

It is not working for me on Windows 10 as well.

Re: Need help to compress files into ESP32

Posted: Sun Jun 16, 2019 10:49 am
by Ritesh
Sorry, we hadn't did any work for that as our client dropped that requirement due to uncertainty of component present into ESP32 IDF at that time.

So, it will be good if you can continue and provide proper solution which might be helpful for others as well.

Let me know if you need any help regarding that or need any further support for that

Re: Need help to compress files into ESP32

Posted: Mon Jun 17, 2019 4:28 pm
by snahmad75
I tried

https://stackoverflow.com/questions/113 ... ip-on-zlib.

It works on windows platform.

zipOpen just hangs on esp32 platform.

Unzip using zlib and minzip is working for me to Esp32 platform.

Any idea?