# File.View(Text [, Boolean]) Method
> Version: _Available or changed with runtime version 15.0._
Opens a file from server computer on the client computer in preview mode. The client computer is the computer that is running the browser that accesses the web client.
> NOTE
> This method is supported only in Business Central on-premises.
## Syntax
```al
[Ok := ]  File.View(FromFile: Text [, AllowDownloadAndPrint: Boolean])
```
> NOTE
> This method can be invoked without specifying the data type name.
## Parameters
FromFile
Type: ../text/text-data-type
The name of the file on the server that you want to preview on the client computer.
*[Optional] AllowDownloadAndPrint*
Type: ../boolean/boolean-data-type
Whether to allow the user to download or print the file from the client or not.
## Return Value
*[Optional] Ok*
Type: ../boolean/boolean-data-type
true if the viewer was opened on the client; otherwise false. If you omit this optional return value and the operation does not execute successfully, a runtime error will occur.
## Remarks
This method works only in Business Central on-premises environments. For online environments, use file-viewfromstream-method.
## Example
This example shows how to use the File.View method to preview a file that resides on the Business Central server on the client computer.
```al
procedure ViewServerFileOnClient()
var
    ServerFileName: Text;
    Success: Boolean;
begin
    // Full path to a file that exists on the Business Central server computer
    ServerFileName := 'C:\Temp\Top10Customers.pdf';

    // Open the file on the client computer in preview mode,
    // allowing the user to download and print it
    Success := File.View(ServerFileName, true);

    // Handle the case where the file could not be displayed
    if not Success then
        Error('Failed to display the file.');
end;
```
> TIP
> Use this method to provide the built-in file preview experience in Business Central for supported PDF and image files. Users can preview content directly in the client instead of downloading the file first.
> Supported image formats include JPEG, JPG, PNG, BMP, SVG, WEBP, ICO, GIF, and AVIF. On Safari, TIFF and TIF images are also supported.
> The base application uses this method to preview attachments on sales documents, item cards, and other records. Learn more in the Table "Document Attachment" reference.
## Related information
file-data-type
Getting started with AL<../../devenv-get-started>
Developing extensions<../../devenv-dev-overview>

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/file/file-view-method, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/methods-auto/file/file-view-method/
