Use the native File Browsers
on Mac & Windows!

Features
– Open File Panel / Open Multiple Files Panel,
– Open Folder Panel / Open Multiple Folders Panel,
– Save File Panel,
– Define a starting directory,
– Define the file extensions to be used,
– Clean and documented C# code,
– Rich demo scene.

Screenshots

Screenshot1

Testimonials

Introduction

Native File Browser provides an easy way to use the native File Browser on Mac and Windows.
You just call a static methods from the FileBrowser class, and it will display the file browser window for you, giving you a callback for when a file/folder is selected.

You can use the FileBrowser wrapper class if you’re developing for both Mac and Windows, this will automatically call the correct platform methods.
So, using FileBrowser.OpenFilePanel will automatically call:
FileBrowserMac.OpenFilePanel on Mac
FileBrowserWindows.OpenFilePanel on Windows
With that, you don’t have to take care of checking the current platform with Application.platform.

But if you want, you can use the FileBrowserMac and FileBrowserWindows classes and not use the FileBrowser wrapper class.
There’s some small differences between each platform (for example, only Windows allow to define a title), so when calling FileBrowser.OpenFilePanel(title), the title will only be used on Windows.
That’s why the FileBrowserMac.OpenFilePanel does not have a title parameter.

Requirements

– In PlayerSettings (Edit -> ProjectSettings -> Player), you need to set Api Compatibility Level to NET 2.0 Subset (if you use .NET 2.0, it won’t work).
– Unity >= 5.5.1

Open File Panel

Opens the select file panel (Select a single file).
Will only allow to select files with extension defined in extensionArray.

Parameters:
title: Title (Only available on Windows).
startingDirectory: Starting directory (if null, will use the last opened folder).
extensionArray: Extension array (specify only the extension, no symbols (,.*) – example “jpg”, “png”). If null, it will allow any file.
onDone: Callback called when a file has been selected (It has two parameters. First (bool) to check if the panel has been canceled. Second (string) is the file selected).

Open Multiple Files Panel

Opens the select multiple files panel (Select multiple files).
Will only show files with extension defined in extensionArray.

Parameters:
title: Title (Only available on Windows).
startingDirectory: Starting directory (if null, will use the last opened folder).
extensionArray: Extension array (specify only the extension, no symbols (,.*) – example “jpg”, “png”). If null, it will allow any file.
onDone: Callback called when files have been selected (It has two parameters. First (bool) to
check if the panel has been canceled. Second (string[]) is the file selected array).

Open Folder Panel

Opens the select folder panel (Select a single folder).

Parameters:
title: Title (Only available on Windows).
startingDirectory: Starting directory (if null, will use the last opened folder).
onDone: Callback called when a folder has been selected (It has two parameters. First (bool) to check if the panel has been canceled. Second (string) is the folder selected).

Open Multiple Folders Panel

Opens the select multiple folders panel (Select multiple folders).

Parameters:
title: Title (Only available on Windows).
startingDirectory: Starting directory (if null, will use the last opened folder).
onDone: Callback called when folders have been selected (It has two parameters. First (bool) to check if the panel has been canceled. Second (string[]) is the folder selected array).

Save File Panel

Opens the save file panel (Save a file).
Will set the file types dropdown with the extensions defined in extensionArray, if not null.

Parameters:
title: Title (Only available on Windows).
message: A hint message on top of the panel, to display a hint to users (Only available on Mac).
startingDirectory: Starting directory (if null, will use the last opened folder).
defaultName: Default Name of the file to be saved. (If null, no name is pre-filled in the inputField).
extensionArray: Extension array (specify only the extension, no symbols (,.*) – example “jpg”, “png”). If null, it will allow any file.
onDone: Callback called when a folder has been selected (It has two parameters. First (bool) to check if the panel has been canceled. Second (string) is the folder selected).

How to update Native File Browser

1. Delete everything under the ‘FileBrowser’ folder from the Project View
2. Import the latest version

Version 1.0.8 - July 9, 2018

  • NEW: Compatible with Unity 2017 and Unity 2018,
  • NEW: Removed the use of a .exe file for Windows, everything is now under a single DLL,
  • NEW: Added support for 32/64 bits for both Windows/OSX. There is a FileBrowserConfigurator script that will configure the DLLs (Windows) and bundles (OS X) to the correct Platform Settings. So when you build for Windows 64 bits, only the 64 bits version of the DLL will be included in your build,
  • NEW: Added more demos to show multiple uses of the file browser,
  • UPDATE: Removed the use of the NativeFileBrowserDispatcher that is now useless,

Version 1.0.7 - April 20, 2017

  • NEW: Fixed issue when throwing an exception in the callback method on OS X,
  • NEW: The filePath returned when cancel is clicked is now null (previously it was “cancel”).

Version 1.0.6 - March 27, 2017

  • NEW: Added #define NATIVE_FILE_BROWSER in case you need to use this with scripting define symbol,
  • NEW: A dispatcher is now automatically included and use to “push” results to the main thread.

Version 1.0.5 - December 11, 2016

  • NEW: Windows: Having multiple extensions is now displayed under a single dropdown (instead of multiples).

Version 1.0.4 - September 29, 2016

  • NEW: Added possibility to define the button name on Mac (not easily possible on Windows).

Version 1.0.3 - September 9, 2016

  • FIX: Windows: Fixed issue happening when a LOT of files were selected.

Version 1.0.2 - August 10, 2016

  • FIX: Windows: Fix startingDirectory not working if the path contained / instead of \. You can now safely use paths with either / or \.
  • FIX: Windows: Fixed possible issue because result return was not Trim(),
  • NEW: Added FAQ “Why are you using a .exe file on Windows?”.

Version 1.0.1 - August 5, 2016

  • FIX: Fixed Native File Browser not working when building with architecture x86 on Mac. It now works with any architecture (Universal, x86 and x64),
  • NEW: The FileBrowser on Mac now always display the “Create folder” button.

Version 1.0.0 - July 26, 2016

  • Initial release.

Support

FAQ

What platforms are supported?

Only Mac and Windows standalone platforms are supported.

How can I help?

Thank you! You can take a few seconds and rate the tool in the Asset Store and leave a nice comment, that would help a lot 😉

What's the minimum Unity version required?

Native File Browser will work starting with Unity 5.5.1.