---
id: change/bcapps/11733
type: change
title: "#11733 Fix external storage migration for unsafe attachment filenames"
summary: Attachments with unsafe filenames now migrate to external storage because generated storage paths are sanitized while displayed names stay unchanged. Each sync step runs in isolation so one failure rolls back only that step, failures are registered per attachment, and the app no longer deletes remote files, only retiring local references under a guard.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit da ext. storage sync worker
  - report da external storage sync
  - codeunit da external storage impl.
  - tableextension document attachment ext.stor.
  - page document attachment - external
  - permissionset da ext. stor. admin
system: platform
review:
  state: reviewed
  by: opus
  at: "2026-10-18T00:55:27.655Z"
  flags: []
generated:
  at: "2026-11-23T00:15:10.597Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: f935787084dcfc2daacdae91f94bd916a5105ebb
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/11733
    title: "microsoft/BCApps#11733: Fix external storage migration for unsafe attachment filenames"
    date: "2026-10-09"
    commit: f935787084dcfc2daacdae91f94bd916a5105ebb
    t: null
    quote: Sanitize generated storage/media-import filenames without changing displayed File Name or File Extension.
links:
  learn: []
  objects:
    - object/codeunit/8755
    - object/report/8752
    - object/codeunit/8751
    - object/tableextension/8750
    - object/page/8751
    - object/permissionset/8751
    - object/page/8750
    - object/table/8750
    - object/codeunit/8754
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
  related:
    - to: https://learn.microsoft.com/dynamics365/business-central/across-store-document-attachments-externally
      title: Store Document Attachments in External File Storage
      label: possibly related
      why: External file storage for document attachments configuration and migration management.
      by: model
number: 11733
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/11733
kind: pr
base_branch: main
major: "30"
merged_at: "2026-10-09T09:35:49Z"
author: darjoo
author_type: User
community_contribution: false
labels:
  - "AL: Apps (W1)"
  - "AL: System Application"
  - "Team: Integrations"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 15
  additions: 1544
  deletions: 164
  al: 9
apps:
  - External Storage - Document Attachments
objects_touched:
  - key: codeunit/8755
    page: codeunit/8755
    type: codeunit
    id: 8755
    name: DA Ext. Storage Sync Worker
    app: External Storage - Document Attachments
    status: added
  - key: report/8752
    page: report/8752
    type: report
    id: 8752
    name: DA External Storage Sync
    app: External Storage - Document Attachments
    status: modified
  - key: codeunit/8751
    page: codeunit/8751
    type: codeunit
    id: 8751
    name: DA External Storage Impl.
    app: External Storage - Document Attachments
    status: modified
  - key: tableextension/8750
    page: tableextension/8750
    type: tableextension
    id: 8750
    name: Document Attachment Ext.Stor.
    app: External Storage - Document Attachments
    status: modified
  - key: page/8751
    page: page/8751
    type: page
    id: 8751
    name: Document Attachment - External
    app: External Storage - Document Attachments
    status: modified
  - key: permissionset/8751
    page: permissionset/8751
    type: permissionset
    id: 8751
    name: DA Ext. Stor. Admin
    app: External Storage - Document Attachments
    status: modified
  - key: page/8750
    page: page/8750
    type: page
    id: 8750
    name: DA External Storage Setup
    app: External Storage - Document Attachments
    status: modified
  - key: table/8750
    page: table/8750
    type: table
    id: 8750
    name: DA External Storage Setup
    app: External Storage - Document Attachments
    status: modified
  - key: codeunit/8754
    page: codeunit/8754
    type: codeunit
    id: 8754
    name: DA Feature Telemetry
    app: External Storage - Document Attachments
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 647832
systems:
  - platform
quote: Sanitize generated storage/media-import filenames without changing displayed File Name or File Extension.
joined_against:
  major: "30"
  commit: eb2bfe5258a473c969a6b85cdc98ce8524408706
---

# #11733 Fix external storage migration for unsafe attachment filenames

> Attachments with unsafe filenames now migrate to external storage because generated storage paths are sanitized while displayed names stay unchanged. Each sync step runs in isolation so one failure rolls back only that step, failures are registered per attachment, and the app no longer deletes remote files, only retiring local references under a guard.

[Pull request](https://github.com/microsoft/BCApps/pull/11733) · merged into `main` (BC30) on 2026-10-09 by darjoo · 15 files (+1544 -164), 9 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Generated storage filenames are sanitized; displayed File Name and File Extension are unchanged
- Each synchronization step runs through a worker; failures roll back that step and processing continues
- Failed attachments are registered locally; interactive runs show Error Messages, background runs do not fail the job queue entry
- Uploaded files are retained after failed persistence and their logical paths recorded for recovery
- All remote deletion calls are removed; local references are retired only under a guarded check
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 8755 "DA Ext. Storage Sync Worker"](../../objects/codeunit/8755.md), External Storage - Document Attachments: added
- [Report 8752 "DA External Storage Sync"](../../objects/report/8752.md), External Storage - Document Attachments: modified
- [Codeunit 8751 "DA External Storage Impl."](../../objects/codeunit/8751.md), External Storage - Document Attachments: modified
- [Table extension 8750 "Document Attachment Ext.Stor."](../../objects/tableextension/8750.md), External Storage - Document Attachments: modified
- [Page 8751 "Document Attachment - External"](../../objects/page/8751.md), External Storage - Document Attachments: modified
- [Permission set 8751 "DA Ext. Stor. Admin"](../../objects/permissionset/8751.md), External Storage - Document Attachments: modified
- [Page 8750 "DA External Storage Setup"](../../objects/page/8750.md), External Storage - Document Attachments: modified
- [Table 8750 "DA External Storage Setup"](../../objects/table/8750.md), External Storage - Document Attachments: modified
- [Codeunit 8754 "DA Feature Telemetry"](../../objects/codeunit/8754.md), External Storage - Document Attachments: modified

## Context

- Work items: AB#647832
- Labels: AL: Apps (W1), AL: System Application, Team: Integrations
- Systems: platform
- From the description: "Sanitize generated storage/media-import filenames without changing displayed File Name or File Extension."

## Possibly related

No source states these links: they share an object, a model read them, or a person found the same subject.

- [Store Document Attachments in External File Storage](https://learn.microsoft.com/dynamics365/business-central/across-store-document-attachments-externally) — possibly related: External file storage for document attachments configuration and migration management. (model-linked)

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
