QLPreviewPanel.AddFile
----------------------

Adds file to the file list for preview.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [QuickLook](component_QuickLook.md) | [4.3](newinversion43.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "QLPreviewPanel.AddFile"; Path ) 

**MBS**( **"QLPreviewPanel.AddFile";** /\* Adds file to the file list for preview. \*/  
**$Path**) /\* The native file path to the image file.e.g. "/Users/test/Images/test.jpg" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Path | The native file path to the image file. | "/Users/test/Images/test.jpg" |

### Result

Returns Ok or error.

### Description

Adds file to the file list for preview.  
If you want the user to select a path, please use [FileDialog](component_FileDialog.md) functions.  
  
A QLPreviewController can display previews for many common file types, including the following:  
  
- iWork documents
- Microsoft Office documents
- Rich text format, or RTF, documents
- PDF files
- Images
- Text files with a uniform type identifier that conforms to the public.text type. To learn more, see Uniform type identifiers.
- Comma-separated values, or CSV, files
- 3D models in the USDZ format with both standalone and AR views for viewing the model

The list of supported common file types may change between operating system releases. In addition, you can enable previews for your own file types by implementing your own preview extension.   
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
### See also

- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [QLPreviewPanel.AddContainer](QLPreviewPanelAddContainer.md)
- [QLPreviewPanel.AddImage](QLPreviewPanelAddImage.md)
- [QLPreviewPanel.AddPDF](QLPreviewPanelAddPDF.md)
- [QLPreviewPanel.Hide](QLPreviewPanelHide.md)
- [QLPreviewPanel.IsVisible](QLPreviewPanelIsVisible.md)
- [QLPreviewPanel.Resize](QLPreviewPanelResize.md)
- [QLPreviewPanel.SavedFiles](QLPreviewPanelSavedFiles.md)
- [QLPreviewPanel.Show](QLPreviewPanelShow.md)

### Example Databases

- [Mac only/Icon and QuickLook/QuickLook Preview Panel](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Icon%20and%20QuickLook/QuickLook%20Preview%20Panel.shtml#1ScriptAnchor_)

This function checks for a license.

Created 18th August 2014 , last changed 29th June 2023

  
[QLPreviewPanel.AddContainer](QLPreviewPanelAddContainer.md) - [QLPreviewPanel.AddImage](QLPreviewPanelAddImage.md)

[HTML Version](QLPreviewPanelAddFile.shtml)