{"title":"File.Upload(Text, Text, Text, Text, var Text) Method","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/file/file-upload-method/","by":"JOP-AL","license":"Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/file/file-upload-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/file/file-upload-method","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sends a file from the client computer to the server computer.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":1,"title":"File.Upload(Text, Text, Text, Text, var Text) Method","slug":"fileuploadtext-text-text-text-var-text-method","at":0,"chars":3486},{"level":2,"title":"Syntax","slug":"syntax","at":392,"chars":206},{"level":2,"title":"Parameters","slug":"parameters","at":598,"chars":1455},{"level":2,"title":"Return Value","slug":"return-value","at":2053,"chars":238},{"level":2,"title":"Remarks","slug":"remarks","at":2291,"chars":795},{"level":2,"title":"Example","slug":"example","at":3086,"chars":268},{"level":2,"title":"Related information","slug":"related-information","at":3354,"chars":132}],"text":"# File.Upload(Text, Text, Text, Text, var Text) Method\n> Version: _Available or changed with runtime version 1.0._\nSends a file from the client computer to the server computer. The client computer is the computer that is running the Windows client or the computer that is running a browser that accesses the web client.\n> NOTE\n> This method is supported only in Business Central on-premises.\n## Syntax\n```al\n[Ok := ]  File.Upload(DialogTitle: Text, FromFolder: Text, FromFilter: Text, FromFile: Text, var ToFile: Text)\n```\n> NOTE\n> This method can be invoked without specifying the data type name.\n## Parameters\nDialogTitle\nType: ../text/text-data-type\nThe title that you want to display in the dialog box for uploading the file. This parameter is not supported by the web client. The title is determined by the end-user's browser.\nFromFolder\nType: ../text/text-data-type\nThe name of the folder that is displayed in the dialog box. This is the default value, and the user can change it. This parameter is not supported by the web client. The browser uses the folder that was last accessed.\nFromFilter\nType: ../text/text-data-type\nThe type of file that can be uploaded to the server. In the Windows client, the type is displayed in the upload dialog box, so that the user can only select files of the specified type. For the web client, a user can try to upload any file type but an error occurs if the file is not the specified type.\nFromFile\nType: ../text/text-data-type\nThe default file that you want to upload to the service. The name displays in the dialog box for uploading the file. The user can change the file. This parameter is not supported by the web client.\nToFile\nType: ../text/text-data-type\nThe path and file name to give the uploaded file. If you do not provide a path, or you upload the file that uses web client, then the file is uploaded to the following folder on the computer that is running the server: \\\\ProgramData\\\\Microsoft\\\\Microsoft Dynamics NAV\\\\110\\\\Server\\\\MicrosoftDynamicsNAVServer$DynamicsNAV110\\\\users\\\\ServiceAccount\n## Return Value\n*[Optional] Ok*\nType: ../boolean/boolean-data-type\ntrue if the operation was successful; otherwise false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.\n## Remarks\n> NOTE\n> This method is not supported on devices that run Apple iOS, such as iPad. The dialog box for uploading a file displays, but it is disabled and the user cannot select a file.\nThe business logic is run on the Dynamics 365 Business Central service and not on the client. Files are created on the Dynamics 365 Business Central service and not locally on the client.\nfile-upload-method and file-uploadintostream-string-string-string-text-instream-method are used to send a file from the client to a Dynamics 365 Business Central service.\nfile-download-method and file-downloadfromstream-method are used to send a file from a Dynamics 365 Business Central service to the client.\nWe recommend that you use the methods in codeunit 419, File Management, to upload and download files.\n## Example\nThe FromFilter parameter must follow this pattern:\n`<ExtensionGroupName>|<extension1>;<extension2>`, for example `'Word files|*.docx;*.doc'`.\nThis example uses a text file:\n```al\nUpload('Upload file','C:\\','Text file (*.txt)|*.txt','Test.txt',varTest);\n```\n## Related information\nfile-data-type\nGet Started with AL<../../devenv-get-started>\nDeveloping Extensions<../../devenv-dev-overview>"}