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 |
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.
[Ok := ] File.UploadIntoStream(FromFilter: Text, var InStream: InStream)
Note
This method can be invoked without specifying the data type name.
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
[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.
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.
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;
}