AEM Assets: Integrate filename sanitization with standard upload workflow
This article describes how to integrate filename sanitization into the standard Adobe Experience Manager (AEM) Assets upload workflow to maintain features such as automatic asset list refresh, uploader attribution, and duplicate detection.
Description description
When custom filename sanitization is implemented during asset uploads in AEM Assets using a custom upload extension that bypasses the standard upload UI, several issues can occur. These include the need to manually refresh the asset list to see new uploads, incorrect uploader attribution, and missing duplicate filename detection dialogs. These behaviors are tied to the standard AEM Assets upload workflow and may not function as expected if bypassed.
Environment
Adobe Experience Manager as a Cloud Service (all versions)
Symptoms
- Uploaded assets do not appear automatically in the Assets UI; a manual page reload is required.
- The “uploaded by” field shows a system user instead of the actual user.
- Duplicate filename detection dialogs are not triggered for assets with the same name in the same folder.
- Upload performance differences are observed between custom and standard upload flows.
Cause
Custom upload extensions that bypass the standard AEM Assets upload UI do not trigger built-in UI behaviors such as automatic refresh, uploader attribution, and duplicate detection dialogs. These features are integrated with the standard upload workflow.
Resolution resolution
Follow the steps below to resolve the issue.
-
Use the standard AEM Assets upload UI for asset uploads.
-
Integrate your filename sanitization logic into the standard upload workflow by adding client-side or server-side validation before the upload is initiated. For example:
- Add a filename validation step in your custom UI component that calls the standard upload dialog only if the filename passes your sanitization rules.
- Alternatively, implement a server-side check before the
initiateUploadAPI call to enforce stricter filename or duplicate rules.
-
Ensure uploads are performed under the actual user’s session or authentication token to maintain correct uploader attribution. If uploads must be performed using a system user, consider storing the actual uploader’s identity in a dedicated metadata field, such as
uploadedBy. -
Rely on the standard UI to handle duplicate detection. The standard upload UI will prompt users with a conflict dialog if an asset with the same name exists in the target folder. Note that binary duplicate detection using
dam:sha1is asynchronous and reports to the Inbox; it does not block uploads. -
After integrating your sanitization logic, verify the following:
- Uploaded assets appear automatically in the Assets UI without a manual refresh.
- The correct user is shown in the “uploaded by” field.
- Duplicate filename dialogs are triggered as expected.