
Client Portal Document Versions: Keep Reviews and Approvals Attached to the Right File
Manage client document revisions with stable identities, version-specific decisions, clear current-file labels, and controlled access.
Custom Portals
Rename portal attachments as metadata while preserving stable document references, version history, permissions, and safe download filenames.

LET’S BUILD SOMETHING USEFUL
Talk to ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED about your website, app, or custom software.
Renaming an attachment looks like a small convenience until the name doubles as its storage location, public reference, or audit identifier. A user corrects “final-final-report.pdf,” and an approval link stops working. A background job still looks for the old object key. Another user opens an old notification and finds a different document with the reused name.
A portal should separate a document’s identity from its visible label. Consider a supplier portal where a vendor uploads a compliance document and later changes its display name to match the buyer’s naming convention. The document, version, permissions, and approval evidence should remain the same. Only the label changes unless the user explicitly performs a different operation. This boundary makes renaming predictable and protects references that must outlive a particular filename.
Use a stable document ID for application references and a separate version ID for specific file contents. Keep the storage key as an implementation detail controlled by the server. Store the user-facing name as metadata. Existing links, approval records, and background jobs should resolve through stable identifiers rather than searching for whichever object currently has the same visible name. Duplicate display names can then be handled as a presentation issue instead of an identity collision.
OWASP’s File Upload Cheat Sheet recommends application-generated filenames and careful validation of uploaded files. That guidance supports keeping an original or edited display name separate from the storage identity. Preserve the original supplied name where it is useful for audit or support, with appropriate access controls. Do not expose it automatically in every public context if it contains personal information. A rename should update the intended label field, not trigger an unplanned storage move.
Decide whether the portal renames a document container, a particular version, or the filename proposed when downloading. Those may be related but are not necessarily identical. A document container named “Supplier insurance” can contain several annual versions, each with its own uploaded filename. Make the edit label reflect the scope, such as “Document name,” and show the current version separately. This avoids implying that a metadata edit creates new file contents.
For the supplier example, changing the container name should preserve its version history and approval status unless the business explicitly treats the name as approval-relevant data. If it does, define that rule and show the consequence before saving. Do not silently reset an approval merely because a user corrected punctuation. Conversely, do not let a rename disguise the replacement of file contents. Replacing a document should remain a distinct operation with version and review behavior that users can understand.
Set a reasonable length limit and reject empty names after the application’s documented normalization. Render the label as escaped text wherever it appears. Do not interpret slashes, backslashes, dot segments, control characters, or markup as instructions for storage or page rendering. If the product allows punctuation that is awkward on some desktop filesystems, define a separate safe download-name transformation while preserving the meaningful display label in the portal.
Handle extensions deliberately. A rename must not change the actual content type or make a rejected upload acceptable. If the UI allows editing only the base name, keep the known extension visible and explain that behavior. If it allows a full label, ensure download handling still uses trusted content metadata rather than the user’s suffix alone. Test Unicode names, long names, whitespace-only input, and names that differ only in case. Decide whether duplicates are allowed and provide enough context to distinguish them when they are.
Check rename permission on the server against the document and current user. Being able to view or download an attachment does not necessarily grant permission to change its label. Recheck the document’s current state when saving, including whether it has been archived or moved into a workflow that restricts edits. A disabled button is helpful feedback, but it does not replace the server’s decision.
Use a revision or other concurrency mechanism appropriate to the application so two editors do not unknowingly overwrite each other’s changes. If the name changed after a user opened the form, show the current value and let them decide how to proceed. Keep the original input available so they do not have to type it again. After success, return the saved name and current revision from the server. Do not show a permanent success state based only on an optimistic local update that the server later rejected.
Update the active document list, search index, recent-items panel, and any cached metadata that should show the current name. Use the stable document ID to locate those records. A delayed search update should not cause a broken link; it may temporarily display an older label while still resolving the correct document. Record the old and new names in an audit event with actor and time, subject to the portal’s data retention rules.
Historical evidence may need the name as it appeared at the time of an action. An approval receipt could preserve that snapshot while also linking to the current document. Do not rewrite every historical event to the new label and erase the context of the original decision. Notifications already sent should continue to resolve through stable links. If an old link embeds a name for readability, treat that segment as decorative or provide a safe redirect rather than making it the only lookup key.
Construct download headers using framework-supported encoding and a sanitized filename policy. Never concatenate an arbitrary user label directly into a raw header or filesystem path. Preserve the correct file type and ensure that changing a name does not change who can download the content. Test the resulting filename in the browsers and operating systems your users rely on, including non-ASCII characters and names long enough to stress the presentation.
AI can suggest a clearer document title from approved metadata, but the user should review the suggestion and its scope. Do not infer confidential contents or invent a certification status from a filename. Keep the original identity and version unchanged when accepting a suggestion. Test rename during an active preview, after another user edits the label, and while a download is being prepared. Include an uncertain network response: read the current metadata before retrying so the interface can distinguish an already saved rename from a failed attempt.
Attachment renaming should be a controlled metadata change with a clear scope. Preserve stable document and version identities, validate labels safely, authorize edits, and reconcile concurrent or uncertain saves. Refresh current views while retaining meaningful historical evidence. Downloads should use a separate safe filename process without changing content or access rights. With those boundaries, users can improve document names confidently, and the portal’s links, approvals, previews, and background work remain attached to the same document throughout its lifecycle.
LET’S BUILD SOMETHING USEFUL
Talk to ATARAXY DEVELOPERS (SMC-PRIVATE) LIMITED about your website, app, or custom software.