Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add data files and then delete other entries, abnormal data will appear in the zip archive. #228

Open
lindyer opened this issue Jun 14, 2024 · 1 comment

Comments

@lindyer
Copy link

lindyer commented Jun 14, 2024

/*read zip file to buffer */
auto za = ZipArchive::fromWritableBuffer(buffer, buffer_size, ZipArchive::Write);
/* read file1 to buf */
za.addData("path/to/file1", file1_buffer, file2_buffer_size, true);
za.deleteEntry("path/to/file2");
za.close(); 
/* write buffer to zip file */
/* when decompressing with 7z, it prompts "Invalid data besides valid data" */
@lindyer lindyer changed the title Can not close a zip archive create from writable buffer normally after delete entries Add data files and then delete other entries, abnormal data will appear in the zip archive. Jun 14, 2024
@ctabin
Copy link
Owner

ctabin commented Jun 15, 2024

Hi @lindyer,

Maybe something related to fromWritableBuffer ? 🤔 Is it working if you use a regular file instead of a memory zip ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants