Skip to content

Latest commit

 

History

History
80 lines (59 loc) · 3.18 KB

file-uploadintostream-string-instream-method.md

File metadata and controls

80 lines (59 loc) · 3.18 KB
title description ms.author ms.date ms.topic author ms.reviewer
File.UploadIntoStream(Text, var InStream) Method
Sends a file from the client computer to the corresponding server.
solsen
05/14/2024
reference
SusanneWindfeldPedersen
solsen

File.UploadIntoStream(Text, var InStream) Method

Version: Available or changed with runtime version 7.0.

Sends a file from the client computer to the corresponding server. The client computer is the computer that is running a browser that accesses the web client.

Syntax

[Ok := ]  File.UploadIntoStream(FromFilter: Text, var InStream: InStream)

Note

This method can be invoked without specifying the data type name.

Parameters

FromFilter
 Type: Text
The type of file that can be uploaded to the server. A user can try to upload any file type but an error occurs if the file is not the specified type.

InStream
 Type: InStream

Return Value

[Optional] Ok
 Type: Boolean
true 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.

Remarks

Note

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 turned off and the user cannot select a file.

The business logic runs on the [!INCLUDEd365fin_server_md] and not on the client. Files are created on [!INCLUDEd365fin_server_md] and not locally on the client computer.

Use Upload Method (File) and UploadIntoStream Method (File) to send a file from the client to the [!INCLUDEd365fin_server_md].

Use Download Method (File) and DownloadFromStream Method (File) to send a file from the [!INCLUDEd365fin_server_md] to the client.

We recommend that you use the methods in codeunit 419, File Management, to upload and download files.

Example

The FromFilter parameter must follow this pattern: <ExtensionGroupName>|<extension1>;<extension2>, for example 'Word files|*.docx;*.doc'.

codeunit 50100 MyCodeunit
{

    procedure MyProcedure()
    var
        FromFilter: Text;
        NVInStream: InStream;
    begin
        FromFilter := 'All Files (*.*)|*.*';
        UploadIntoStream(FromFilter, NVInStream);
    end;

}

See Also

File Data Type Get Started with AL Developing Extensions