GROW WITH ATARAXYBuild skills. Get real experience.Explore internships and education support.

Custom Portals

Portal ZIP Downloads: Build a Manifest for Complete and Partial Document Bundles

Build portal ZIP downloads from an explicit manifest, with version snapshots, permission checks, collision-safe names, and visible partial outcomes.

LET’S BUILD SOMETHING USEFUL

Have a project in mind?

Talk to ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED about your website, app, or custom software.

A “Download selected files” button creates an expectation that every selected document will appear in the archive. That expectation breaks when one file is unavailable, two files share a name, or access changes while a large bundle is being prepared. A ZIP that opens successfully can still be an incomplete or misleading result.

Treat a document bundle as a job with a manifest. Consider a project portal where a client selects drawings, specifications, and approval records for an offline review. The bundle should state which versions were requested, which files were included, and whether anything was omitted. Its success condition is more precise than “a ZIP was generated.” The user needs a dependable package and an understandable explanation of any difference between the requested set and the delivered set.

Capture an explicit selection snapshot

When the user starts the download, resolve the selection into document IDs and version IDs. Do not leave the worker to rerun a changing “all visible files” query hours later unless that dynamic behavior is explicitly part of the product. Record the initiating user, project scope, creation time, and the chosen bundle policy. A stable snapshot makes retries and support investigations refer to the same intended package.

For a selected folder, define whether selection includes only current children or recursively includes nested folders. Show a count and estimated size when reliable metadata is available. Explain whether the bundle uses versions current at request time or versions current when processing begins. Avoid mixing these rules silently. If the application cannot retain access to the selected versions long enough to build the package, either reserve them through an approved mechanism or warn that the selection may need to be refreshed before generation.

Recheck access before reading and before delivery

The worker must authorize each document in the initiating user’s current scope before reading its contents. Possession of an internal object key is not sufficient. A request accepted earlier should not grant indefinite access after the user is removed from the project. Recheck authorization when presenting or downloading the completed archive as well. The bundle is a new object containing potentially many protected documents and needs its own access and expiry rules.

Decide how permission changes affect the job. For sensitive project packages, failing the whole bundle may be clearer than returning a partial archive. For other workflows, an explicitly partial result can be acceptable. Do not include the titles of newly inaccessible documents in a public error manifest if that would disclose information the user may no longer see. Use a safe omission category and an internal diagnostic reference where detailed explanation would cross the current access boundary.

Create archive names that cannot collide or escape folders

Choose archive entry names independently of storage keys. Two documents called “report.pdf” need distinct entries, perhaps through a stable folder structure or a short document reference. Apply the collision rule consistently and record the final archive path in the manifest. Do not rely on every extraction tool handling duplicate names in the same way. The Python zipfile documentation discusses duplicate member names and archive capabilities; review equivalent behavior in whichever library you use.

Normalize generated entry paths to safe relative paths. Reject or transform absolute paths, parent-directory traversal segments, and names that would become ambiguous on common target filesystems. Use a deliberate policy for case-insensitive collisions and reserved names. Preserve a readable association with the original document label in the manifest. Test a pair of names that differ only by case and a filename containing path separators. A server-created archive should not pass unsafe path strings through merely because they originated as document labels in a trusted database.

Make completeness a product decision

Define whether the job is all-or-nothing or permits partial delivery before implementing error handling. In an all-or-nothing bundle, a missing required file should produce a failed job with a clear recovery action. In a partial bundle, display “Ready with omissions” and explain the included count versus the requested count. Do not use the same success badge for both. The user should know the difference before downloading and again when reading the package manifest.

The manifest can include document references, selected version identifiers, safe display names, archive paths, and inclusion status. Add file sizes or checksums when they support the intended verification process. Keep internal storage addresses and unnecessary personal data out of it. A missing file should have a specific category such as unavailable version or processing failure, subject to access constraints. Avoid vague “skipped” messages that leave the user unable to decide whether the package is suitable for their review.

Bound resource use and publish only finished archives

Large bundles belong in a background workflow with limits on file count, total bytes, processing time, and concurrent jobs. Estimate work from trusted metadata, then enforce limits while reading because metadata can be stale. Choose compression methods and archive-size support that work with the clients you expect. If using ZIP64 for large archives, test the actual extraction tools your users rely on rather than assuming every recipient has identical capabilities.

Write to a temporary object and expose the final download only after the archive and manifest are complete and validated. A failed worker should not leave a partially written file behind a “Ready” button. Retrying should reuse the same selection snapshot and produce a clearly identified new attempt. Clean up abandoned temporary objects according to a scoped policy. Keep the job record long enough to explain the outcome, while setting an appropriate expiry for the downloadable package itself.

Verify the package from the recipient’s perspective

Open the generated archive with representative tools and compare its contents against the manifest. Check entry counts, names, selected versions, file readability, and the explicit partial-result policy. Include empty selections, duplicate names, a removed permission, an unavailable version, a worker interruption, and an expired download. Test that a user from another project cannot access the job status or completed package by changing an identifier.

Measure failures at the job and file level without logging document contents. If a user reports a missing drawing, the job ID and manifest should show whether it was selected, included, or omitted. AI can help summarize an omission report for support, but it should not infer that an omitted file was unimportant or replace deterministic completeness checks. Provide a direct action to retry eligible failures or create a new selection. Keep the existing package’s status accurate rather than silently swapping its contents after the user has already downloaded it.

Conclusion

A reliable ZIP download begins with a selection snapshot and ends with verified contents that match a manifest. Recheck permissions, use safe unique entry names, define partial delivery explicitly, and publish only a finished archive. Bound background work and preserve enough job evidence to explain failures. These choices turn a convenient bulk-download button into a dependable document workflow. The recipient can understand what the package contains, which versions it represents, and whether any missing material needs attention before the offline work begins.

LET’S BUILD SOMETHING USEFUL

Turn what you’ve learned into your next project.

Talk to ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED about your website, app, or custom software.

ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED — Turning Digital Visions Into Reality

ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED builds websites, mobile apps and custom software for businesses in the US, Pakistan and beyond.

Join Our Newsletter

Get insights on software, digital products and automation from our development team.

You have been successfully Subscribed! Ops! Something went wrong, please try again.