SharingPanel.AddFilePath
------------------------

Adds a file to share.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [SharingPanel](component_SharingPanel.md) | [11.4](newinversion114.md) | ❌ No | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "SharingPanel.AddFilePath"; Path { ; Subject } ) 

**MBS**( **"SharingPanel.AddFilePath";** /\* Adds a file to share. \*/  
**$Path**; /\* The native file path to share. \*/   
**$Subject**) /\* Optional; Subject line for sharing via email. \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| Path | The native file path to share. |  |  |
| Subject | Subject line for sharing via email. |  | Optional |

### Result

Returns OK or error.

### Description

Adds a file to share.  
  
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.  
### Examples

Write a PDF to file and then add it for sharing:

 Set Variable \[ $path ; Value: MBS ( "[Path.AddPathComponent](PathAddPathComponent.md)"; MBS ( "[Folders.UserDocuments](FoldersUserDocuments.md)" ); "test.pdf" ) \]   
Set Variable \[ $r ; Value: MBS ( "[Container.WriteFile](ContainerWriteFile.md)"; Sharing::Container ; $path ) \]   
Set Variable \[ $r ; Value: MBS ( "SharingPanel.AddFilePath"; $Path ) \]  
### See also

- [Container.WriteFile](ContainerWriteFile.md)
- [Folders.UserDocuments](FoldersUserDocuments.md)
- [Path.AddPathComponent](PathAddPathComponent.md)
- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [SharingPanel.GetFileName](SharingPanelGetFileName.md)

This function checks for a license.

Created 28th August 2021 , last changed 29th August 2021

  
[SharedMemory.SetValue](SharedMemorySetValue.md) - [SharingPanel.AddImageContainer](SharingPanelAddImageContainer.md)

[HTML Version](SharingPanelAddFilePath.shtml)