UPLOAD Function (File)
Sends a file from the client computer to the Microsoft Dynamics NAV Server computer. The client computer is the computer that is running the Microsoft Dynamics NAV Windows client or the computer that is running a browser that accesses the Microsoft Dynamics NAV Web client.
[Ok :=] UPLOAD(DialogTitle, FromFolder, FromFilter, FromFile, ToFile)
The title that you want to display in the dialog box for uploading the file.
This parameter is not supported by the Microsoft Dynamics NAV Web client. The title is determined by the end-user's browser.
The 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 Microsoft Dynamics NAV Web client. The browser uses the folder that was last accessed.
The type of file that can be uploaded to Microsoft Dynamics NAV Server.
In the Microsoft Dynamics NAV 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 Microsoft Dynamics NAV Web client, a user can try to upload any file type but an error occurs if the file is not the specified type.
The default file that you want to upload to the Dynamics NAV 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 Microsoft Dynamics NAV Web client.
The path and file name to give the uploaded file.
If you do not provide a path, or you upload the file that uses Microsoft Dynamics NAV Web client, then the file is uploaded to the following folder on the computing that is running Microsoft Dynamics NAV Server:
\ProgramData\Microsoft\Microsoft Dynamics NAV\110\Server\MicrosoftDynamicsNAVServer$DynamicsNAV110\users\ServiceAccount
ServiceAccount is the folder for the account for Microsoft Dynamics NAV Server.
Property Value/Return Value
If you omit this optional return value, then a run-time error occurs if the file cannot be found. If you include a return value, then you must handle any errors.
true if the file was uploaded; otherwise, false.
This function is not supported by the Microsoft Dynamics NAV Web client on devices that run Apple iOS, such as iPad. The dialog box for uploading a file displays in the Microsoft Dynamics NAV Web client, but it is disabled and the user cannot select a file.
In Dynamics NAV, the business logic is run on the computer that is running Microsoft Dynamics NAV Server and not on the client. Files are created on the Dynamics NAV service and not locally on the client computer.
We recommend that you use the functions in codeunit 419, File Management, to upload and download files.
UPLOAD('Upload file','C:\','Text file(*.txt)|*.txt','Test.txt',varTest)