archive icon indicating copy to clipboard operation
archive copied to clipboard

Cannot Zip large file

Open duchieupham opened this issue 2 years ago • 2 comments

I'm facing with zipping large file on windows OS and MacOS. If I have a zip file larger than 2Gb, my application crashes when starting zip process. If I have a file large than 2Gb, the zip process seems to have errors. My zip file has just 75-80 bytes size.

duchieupham avatar Jul 13 '22 05:07 duchieupham

You can try using an InputFileStream with the ZipDecoder.

import 'package:archive/archive_io.dart';
void main() {
    var stream = InputFileStream('large_zip_file.zip');
    var zip = ZipDecoder().decodeBuffer(stream);
    for (var file in zip.files) {
        var fileData = file.content;
        // do something with the file data
        file.clear(); // clear the memory
    }
}

brendan-duncan avatar Jul 20 '22 04:07 brendan-duncan

Hello @brendan-duncan Is the above code will be used for ZIPPING or UNZIPP I have tried to ZIP file of size 1.63GB I am getting below error Exhausted heap space, trying to allocate 1629274320 bytes. [VERBOSE-2:ui_dart_state.cc(198)] Unhandled Exception: Out of Memory

numnandkishore avatar Oct 25 '22 13:10 numnandkishore