---
title: "Codeunit 419 File Management"
author: "Jonas Paprotka"
url: https://jonas-paprotka.de/ref/codeunit/419-file-management/
type: codeunit
id: 419
name: "File Management"
app: "Base Application"
namespace: System.IO
versions: "17-28"
build: 28.5.54151.54365
source: "https://jonas-paprotka.de/ref/codeunit/419-file-management/source/29/"
checked: 2026-09-20
subject: "Microsoft Dynamics 365 Business Central"
license: "Content © 2026 Jonas Paprotka. Quote freely with attribution and a link."
---

# Codeunit 419 File Management

Jonas Paprotka, https://jonas-paprotka.de/ref/codeunit/419-file-management/

| | |
| --- | --- |
| App | Base Application |
| Namespace | System.IO |
| Versions | 17-28 |
| Source file | Modules/System/FileOperations/FileManagement.Codeunit.al |

## Procedures

| Name | Parameters | Returns | Access | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- | --- |
| BLOBImport | (var Codeunit Temp Blob, Text) | Text | public | 17-28 | - | - |
| BLOBImportWithFilter | (var Codeunit Temp Blob, Text, Text, Text, Text) | Text | public | 17-28 | - | - |
| BLOBExportWithEncoding | (var Codeunit Temp Blob, Text, Boolean, TextEncoding) | Text | public | 17-28 | - | - |
| BLOBExport | (var Codeunit Temp Blob, Text, Boolean) | Text | public | 17-28 | - | - |
| ServerTempFileName | (Text) | Text | public | 17-28 | - | - |
| ClientTempFileName | (Text) | Text | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| CreateClientTempSubDirectory | () | Text | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| DownloadTempFile | (Text) | Text | public | 17-28 | - | - |
| UploadFileSilent | (Text) | Text | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| UploadFileSilentToServerPath | (Text, Text) | Text | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| UploadFileToServer | (Text) | Text | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false, please use the UploadFile procedure. |
| UploadFile | (Text[50], Text) | Text | public | 17-28 | - | - |
| UploadFileWithFilter | (Text[50], Text, Text, Text) | Text | public | 17-28 | - | - |
| Magicpath | () | Text | public | 17-28 | - | - |
| DownloadHandler | (Text, Text, Text, Text, Text) | Boolean | public | 17-28 | - | - |
| DownloadFromStreamHandler | (InStream, Text, Text, Text, Text) | Boolean | public | 17-28 | - | - |
| DownloadToFile | (Text, Text) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false, please use the DownloadHandler(ServerFileName, '', '', '', ClientFileName) procedure. |
| AppendAllTextToClientFile | (Text, Text) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| MoveAndRenameClientFile | (Text, Text, Text) | Text | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| CreateClientFile | (Text) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| DeleteClientFile | (Text) | Boolean | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| CopyClientFile | (Text, Text, Boolean) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| ClientFileExists | (Text) | Boolean | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false, this procedure will always return false. This procedure will be removed. |
| ClientDirectoryExists | (Text) | Boolean | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false, this procedure will always return false. This procedure will be removed. |
| CreateClientDirectory | (Text) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| DeleteClientDirectory | (Text) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| UploadClientDirectorySilent | (Text, Text, Boolean) | Text | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| MoveFile | (Text, Text) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| CopyServerFile | (Text, Text, Boolean) | - | public | 17-28 | - | - |
| ServerFileExists | (Text) | Boolean | public | 17-28 | - | - |
| DeleteServerFile | (Text) | Boolean | public | 17-28 | - | - |
| ServerDirectoryExists | (Text) | Boolean | public | 17-28 | - | - |
| ServerCreateDirectory | (Text) | - | public | 17-28 | - | - |
| ServerCreateTempSubDirectory | () | Text | public | 17-28 | - | - |
| ServerRemoveDirectory | (Text, Boolean) | - | public | 17-28 | - | - |
| GetFileName | (Text) | Text | public | 17-28 | - | - |
| GetSafeFileName | (Text) | Text | public | 17-28 | - | - |
| GetFileNameWithoutExtension | (Text) | Text | public | 17-28 | - | - |
| HasExtension | (Text) | Boolean | public | 17-28 | - | - |
| GetFileNameMimeType | (Text) | Text | public | 17-28 | - | - |
| GetDirectoryName | (Text) | Text | public | 17-28 | - | - |
| GetClientDirectoryFilesList | (var Record Name/Value Buffer, Text) | - | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| GetServerDirectoryFilesList | (var Record Name/Value Buffer, Text) | - | public | 17-28 | - | - |
| GetServerDirectoryFilesListInclSubDirs | (var Record Name/Value Buffer, Text) | - | public | 17-28 | - | - |
| GetClientFileProperties | (Text, var Date, var Time, var BigInteger) | Boolean | public | 17-19 | Pending 17.3 | IsLocalFileSystemAccessible always returns false and this procedure will always throw an error. |
| GetServerFileProperties | (Text, var Date, var Time, var BigInteger) | Boolean | public | 17-28 | - | - |
| CombinePath | (Text, Text) | Text | public | 17-28 | - | - |
| BLOBImportFromServerFile | (var Codeunit Temp Blob, Text) | - | public | 17-28 | - | - |
| BLOBExportToServerFile | (var Codeunit Temp Blob, Text) | - | public | 17-28 | - | - |
| InstreamExportToServerFile | (InStream, Text) | Text | public | 17-28 | - | - |
| CreateAndWriteToServerFile | (Text, Text) | Text | public | 17-28 | - | - |
| GetToFilterText | (Text, Text) | Text | public | 17-28 | - | - |
| GetExtension | (Text) | Text | public | 17-28 | - | - |
| OpenFileDialog | (Text[50], Text, Text) | Text | public | 17-19 | Pending 17.3 | The local file system is no longer accessible. Please use the UploadFile procedure. |
| SaveFileDialog | (Text[50], Text, Text) | Text | public | 17-19 | Pending 17.3 | The local file system is no longer accessible. The procedure will always return an empty string. This procdure will be removed. |
| SelectFolderDialog | (Text, var Text) | Boolean | public | 17-19 | Pending 17.3 | The local file system is no longer accessible and this procedure will always return false. |
| IsLocalFileSystemAccessible | () | Boolean | public | 17-19 | Pending 17.3 | The windows client type has been retired. This procedure will always return false. |
| IsValidFileName | (Text) | Boolean | public | 17-28 | - | - |
| ValidateFileExtension | (Text, Text) | - | public | 17-28 | - | - |
| CreateFileNameWithExtension | (Text, Text) | Text | public | 17-28 | - | - |
| Ansi2SystemEncoding | (OutStream, InStream) | - | public | 17-28 | - | - |
| Ansi2SystemEncodingTxt | (OutStream, Text) | - | public | 17-28 | - | - |
| BrowseForFolderDialog | (Text[50], Text, Boolean) | Text | public | 17-19 | Pending 17.3 | The procedure uses .NET which does not function on non-Windows client types. |
| StripNotsupportChrInFileName | (Text) | Text | public | 17-28 | - | - |
| ExportImage | (Text, Text) | - | public | 17-28 | - | - |
| IsClientDirectoryEmpty | (Text) | Boolean | public | 17-28 | - | - |
| IsServerDirectoryEmpty | (Text) | Boolean | public | 17-28 | - | - |
| GetFileContent | (Text) | Text | public | 17-19 | Pending 17.0 | GetFileContent will be replaced with GetFileContents. This currently uses InStream.ReadText() which only returns the stream contents up to the first line break character. |
| GetFileContents | (Text) | Text | public | 17-28 | - | - |
| GetFileContents | (Text, TextEncoding) | Text | public | 17-28 | - | - |
| IsAllowedPath | (Text, Boolean) | Boolean | public | 17-28 | - | - |
| SaveStreamToFileServerFolder | (var Codeunit Temp Blob, Text, Text, Text) | Text | public | 17-19 | Pending 17.0 | Use the DownloadFromStream function to save the content of a stream locally. |
| MoveAndRenameServerFile | (Text, Text, Text) | - | public | 17-19 | Pending 17.0 | Server files should not be edited directly on the server. Instead, use the DownloadFromStream function to get a local copy of the file on the server. |
| AppendFileNameWithIndex | (Text, Integer) | Text | public | 18-28 | - | - |
| GetPathWithSafeFileName | (Text) | Text | public | 20-28 | - | - |
| TempBlobToServerFile | (var Codeunit Temp Blob, Text) | Text[250] | internal | 27-28 | - | - |

## Events

| Kind | Name | Parameters | Versions | Obsolete | Reason |
| --- | --- | --- | --- | --- | --- |
| Integration event | OnAfterGetToFilterTextSetOutExt | (Text, var Text) | 17-28 | - | - |
| Integration event | OnBeforeDownloadHandler | (var Text, Text, Text, var Boolean) | 17-20 | - | - |
| Integration event | OnBeforeUploadFileWithFilter | (var Text, Text[50], Text, Text, Text, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeDownloadFromStreamHandler | (var Text, Text, InStream, var Boolean) | 17-28 | - | - |
| Integration event | OnBeforeBlobExport | (var Codeunit Temp Blob, Text, Boolean, var Boolean) | 20-22 | - | - |
| Integration event | OnAfterDownloadHandler | (var Text, Text, Text, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeBlobExportWithEncoding | (var Codeunit Temp Blob, Text, Boolean, TextEncoding, var Text, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeDownloadHandler | (var Text, Text, Text, var Boolean, var Boolean) | 21-28 | - | - |
| Integration event | OnBeforeBlobExport | (var Codeunit Temp Blob, Text, Boolean, var Boolean, var Text) | 23-28 | - | - |

## Source

Symbols: Microsoft.BaseApplication.symbols.437dbf0e-84ff-417a-965d-ed2bb9650972, https://dynamicssmb2.pkgs.visualstudio.com/DynamicsBCPublicFeeds/_packaging/MSSymbols/nuget/v3/index.json, highest build per major on 2026-09-20.
AL source 29: https://github.com/microsoft/BCApps, MIT, releases/29.x at a66254c3b8b5bb1cea290dc8f9d097aec4381153.

Jonas Paprotka, 2026-09-20.
