Documents & OCRPractical guides

Hand off same-name CSVs in a ZIP: preserve paths and verify the downloaded files

Preserve full paths before handing off north/report.csv and south/report.csv. This complete fictional exercise provides a source ZIP, a path-and-byte manifest and a conflict copy. Verify the returned archive and each selected CSV instead of treating a successful download or a browser-added filename suffix as source evidence.

Two old paper folders labeled DOSYA
Illustrative photo: Cht Gsml · Unsplash License

What changed: Added source archives, path-and-byte manifests, full/subset/single-file procedures and a case-conflict input with recovery checks.

The practical answer

A full export must retain the three original file paths and their bytes; a north-only subset retains north/report.csv plus notes.txt and must be labelled partial. Standalone north and south downloads both suggest report.csv, so preserve their source mapping. Repackaging may change the ZIP’s own bytes without changing the contained files.

Give each file an identity using its complete path

The authored exercise contains north/report.csv with N01,100; south/report.csv with S01,250; and notes.txt explaining the sources. Both CSVs have the header id,amount. Different contents and amounts belong to different sources even though their basenames match.

There are three files. Archive applications may also list folder entries, so a count of every displayed line is not necessarily a count of business files. Specify non-directory files in the acceptance manifest.

The three expected files
Complete pathKey contentsWhy retain it
north/report.csvid,amount; N01,100Keep the north source
south/report.csvid,amount; S01,250Keep the south source
notes.txtSynthetic exercise and folder notesExplain the relationship

Open source.zip inside the exercise pack

Extract the outer exercise pack first. source.zip is the three-file business input; case-conflict.zip is a deliberate fault. expected-manifest.csv lists the three original file paths, byte lengths and SHA-256 values; subset-manifest.csv describes the north subset. README and answer files belong to the exercise pack, not to the three-file business count.

Both CSVs contain an id,amount header: north holds N01,100 and south S01,250. Retain source.zip unchanged. A new ZIP can use different compression or timestamps, so compare the contained file bytes rather than requiring the two complete archives to have identical checksums.

The original non-directory files
PathUTF-8 bytesValue to check
north/report.csv18N01,100
south/report.csv18S01,250
notes.txt56Source explanation retained

Choose archive export or a standalone download deliberately

Open the ZIP viewer and extractor, select one archive and inspect its complete entry names before choosing files. Download the selected ZIP, reopen it and compare the paths and contents above. The current implementation repackages full paths rather than flattening matching basenames.

A standalone download is useful for one document, but its suggested filename is the final path segment. Two report.csv downloads may trigger renaming or a save-location prompt. Neither behavior automatically records north versus south. Save into a named source folder or rename explicitly, then record that mapping.

The file checksum and version manifest guide explains byte-level verification. Different checksums establish different files, but cannot decide which records belong in a business total. Provenance and version rules still matter.

Choose by the handoff task

Deliver both departments

Export the selected ZIP with directories and a complete-path manifest.

Take only the north report

Save the standalone file into a north folder or assign an explicit source name.

Prepare a combined report

Retain the original archive before mapping columns; do not guess duplicate business rows during extraction.

Run all three download routes and retain their scope

Use ZIP preview and extraction for each route. The references describe content to compare, not an output already produced on your device. In these tiny fixtures the tool processes files locally; no archive is a substitute for checking the source and intended selection.

  1. Upload source.zip and verify three non-directory files. Leave all selected, click Download selected files as ZIP and retain extracted-files.zip separately from the source. Reopen that downloaded ZIP in the same tool: north/report.csv, south/report.csv and notes.txt should all remain.
  2. Return to source.zip, uncheck Select south/report.csv and leave north/report.csv plus notes.txt selected. Download the two-file subset and compare subset-manifest.csv. Label it a north-only handoff, not the complete original package.
  3. Return to source.zip and use Download file beside north/report.csv, then beside south/report.csv. Both suggest report.csv. Check the first for N01,100 and the second for S01,250; save them with explicit source names or folders and retain download-map.csv.
  4. For the full archive, compare each file’s path, byte count and content with expected-manifest.csv. If you also calculate SHA-256, compare individual file values. A matching total of three files alone cannot detect one CSV being replaced by the other.

Matching basenames are fine; conflicting full paths need review

The current tool blocks unsafe paths and normalized case conflicts. North/report.csv and north/report.csv conflict here; parent-directory paths such as../report.csv also stop processing. Ask the sender for an unambiguous archive rather than arbitrarily removing one entry.

JSZip’s official loader documentation explains that library loading can merge matching entry names and sanitize unsafe relative paths. KitNelo adds checks against original paths, but cannot recover an entry already overwritten by upstream packaging. Three readable files do not prove that all four files a sender intended are present.

An archive opening successfully does not establish benign contents, accurate data or a trusted sender. This guide does not offer password cracking or recovery of missing entries.

Reject the conflict copy and recover from the original

Upload case-conflict.zip in a fresh run. It deliberately contains North/report.csv and north/report.csv. The current tool should report a duplicate/case conflict and disable the selected-ZIP export. These are harmless teaching CSVs; the example tests name handling, not malware detection or a general security certification.

Keep the rejected copy for review and reupload the known source.zip for recovery. Verify its three paths and download again. For real incoming material, request a corrected package with explicit source names; deleting one colliding entry without knowing its contents can discard a valid report.

Reopen the downloaded ZIP before calling the handoff complete

Compare each manifest entry: north still contains N01 and 100; south still contains S01 and 250; notes remains present. Download one file separately and verify its contents against the selected path. This tests directory retention separately from the origin of one download.

The current limits are1000 files,150 MiB of total input and 300 MiB of inflated contents; the interface abbreviates these as MB. Encrypted, multi-volume or unsupported archives cannot be processed, and memory constraints may require smaller batches. A three-file result does not establish reliability for every large archive.

If the next task is combining CSVs, use the different-header merge guide to check columns, source rows and totals. Extraction moves a container; it does not define business deduplication.

The recipient should be able to verify

  • The original ZIP is retained separately.
  • Three non-directory paths match the sender’s manifest.
  • Each report.csv retains its own source contents.
  • Standalone filenames are explicitly mapped to their source.
  • A partial selection is described as a subset.

Common questions

Do distinct filenames make the reports ready to merge?

Renaming resolves identity, not column meaning, dates, amount types or duplicated business records. Retain provenance before applying the actual reporting rules.

Further reading & sources

Put the guide into practice

Open the relevant tool, preview the result and check your exported file.

Related articles