UPLOADINTOSTREAM Function (File)
Sends a file from the client computer to the corresponding Microsoft Dynamics NAV Server. 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 :=] UPLOADINTOSTREAM(DialogTitle, FromFolder, FromFilter, FromFile, NVInStream)
The text displayed in the title bar of the Open dialog box.
This parameter is not supported by the Microsoft Dynamics NAV Web client. The title is determined by the end-user's browser.
The path of the folder that is displayed in the File Open dialog box. This is the default folder, but the user can browse to any available location.
This parameter is not supported by the Microsoft Dynamics NAV Web client. By default, 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 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 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 InStream that is used to send the file.
Property Value/Return Value
If you omit this optional return value, then a run-time error occurs if the record 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.
The maximum size of the file to be uploaded is specified by the MaxUploadSize setting in the CustomSettings.config file. The setting is specified in megabytes. For more information, see Configuring Microsoft Dynamics NAV Server.
In Dynamics NAV, the business logic runs on the computer that is running Microsoft Dynamics NAV Server and not on the client. Files are created on Microsoft Dynamics NAV Server and not locally on the client computer.
We recommend that you use the functions in codeunit 419, File Management, to upload and download files.
This example requires that you create the following variables.
FileName := 'c:\SomeFile.txt'; UPLOADINTOSTREAM('Import','',' All Files (*.*)|*.*',FileName,NVInStream);