UPLOADINTOSTREAM Function (File)

Sends a file from a RoleTailored client to the corresponding Microsoft Dynamics NAV Server.


[Ok :=] UPLOADINTOSTREAM(DialogTitle, FromFolder, FromFilter, FromFile, NVInStream)

Parameters

DialogTitle

Type: Text

The text displayed in the title bar of the Open dialog box.

FromFolder

Type: Text

The path to 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.

FromFilter

Type: Text

The type of file that is displayed in the Open dialog box. This is the default value and the user can change it.

FromFile

Type: Text

The name of the file that is displayed in the Open dialog box. This is the default file name, which the user can change.

NVInStream

Type: Variant

The InStream used to send the file.

Type: Boolean

If you omit this optional return value, a run-time error occurs if the record cannot be found. If you include a return value, it is assumed that you will handle any errors.

true if the file was uploaded; otherwise, false.

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 the new architecture the business logic is run on the Microsoft Dynamics NAV server and not on the client. This means that in Microsoft Dynamics NAV, files are created on the Microsoft Dynamics NAV server and not locally on the client computer as is the case with the Classic client. When you write code for Microsoft Dynamics NAV, you must therefore remember where the files are created.

Use UPLOAD Function (File) and UPLOADINTOSTREAM Function (File) to send a file from a RoleTailored client to Microsoft Dynamics NAV server.

Use DOWNLOAD Function (File) and DOWNLOADFROMSTREAM Function (File) to send a file from a Microsoft Dynamics NAV server to a RoleTailored client.

We recommend that you use the functions in Codeunit 419, 3-Tier Automation Mgt., to upload and download files.

This example requires that you create the following variables.

Name DataType

FileName

Text

NVInStream

InStream

FileName := 'c:\SomeFile.txt';
UPLOADINTOSTREAM(‘Import’,'',’ All Files (*.*)|*.*’,FileName,NVInStream);

Community Additions

ADD
Show: