Search Unity

File Browser - Native file browser for standalone

Discussion in 'Assets and Asset Store' started by Stefan-Laubenberger, Dec 28, 2017.

  1. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    File Browser is a wrapper for native file dialogs on Windows, macOS, Linux and UWP (WSA).

    Features:

    • Works with Windows, macOS, Linux and UWP (PRO only) in editor and runtime
    • Full IL2CPP-support! (PRO only)
    • Open file/folder, save file dialogs supported
    • Multiple file selection
    • Multiple folder selection on macOS and Linux
    • File extension filters
    • Powerful API for maximum control!
    • Detailed demo scenes!
    • Comprehensive documentation and support (PRO only)
    • Compatible with Unity 2017.4 – Unity 2019
    • Full C# source code!
    • PlayMaker actions (PRO only)

    Some impressions:
    01-Singlefile.PNG

    02-Multifiles.PNG

    03-folders.PNG

    04-savefile.PNG

    AssetStore:
    Free edition
    PRO edition

    Our other assets


    Demos:
    Windows
    Mac
    Linux


    Changes


    Feel free to download and test it.
    Any constructive comments are very welcome!


    Cheers
    Stefan
     
    Last edited: Jul 26, 2019
    m4d, sylon, JadsonAlmeida and 2 others like this.
  2. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    548
    I had the plan create it, but you made it sooner, Thanks, Keep up the good work, nicely done.

    Thanks.
     
    Stefan-Laubenberger likes this.
  3. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Thank you for the kind words!

    If you or anybody is interested in getting it right now, just drop me an email :)


    So long,
    Stefan
     
  4. MatsuImg

    MatsuImg

    Joined:
    Jul 11, 2017
    Posts:
    9
    Hello,

    I tried your asset with the following settings.

    Edit > Project Settings > Player > Other Settings > Scripting Runtime Version: "Experimental (.NET 4.6 Equivalent)"
    (Windows standalone application)

    However, I got the errors "Unity Editor or Application.exe has stopped working".
    Does your asset only work if the API compatibility level is .NET 2.0?

    Thank you
     
  5. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    Thank you for using FB!

    Yes, I made a mistake in the "SetApiLevel"-script.
    FB works with newer .NET-versions.

    Here is a fixed version :)



    Cheers
    Stefan
     

    Attached Files:

  6. MatsuImg

    MatsuImg

    Joined:
    Jul 11, 2017
    Posts:
    9
    Hello,

    Now, FB works perfectly with .NET 4.6 compatible settings!
    Your asset is smart and great!!!!!

    I really appreciate your kind response.
    Thank you very much!
     
    Stefan-Laubenberger likes this.
  7. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    You're welcome!

    If you like our product/support and have some spare time left, please rate us at the store. Or even better, write a review - it's very much appreciated.


    So long,
    Stefan
     
  8. MatsuImg

    MatsuImg

    Joined:
    Jul 11, 2017
    Posts:
    9
    Hi,

    I rated and wrote a review at the store right now.
    Very good asset!

    Thank you
     
    Stefan-Laubenberger likes this.
  9. raulprofe

    raulprofe

    Joined:
    Jul 27, 2017
    Posts:
    2
    Hello
    I tried to access from Example.cs to a static variable in a script mine. Don't get it. I guess that the cause is that Example.cs belongs to a namespace. For example, how could I access the public static variable life in my script data1?

    It would be very useful to have a method that will be triggered when the user closes the Windows browser. (Or it does exist and I have not seen it).

    Sorry if I ask things very easy. I do not have much experience in programming.

    Many thanks for your wonderful asset!!!
     
  10. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi Raul

    Example.cs only shows how you could use FB in your own script.
    An example:
    Code (CSharp):
    1. //add this to the start of the script
    2. using Crosstales.FB;
    3.  
    4. //somewhere inside your code
    5. string path = FileBrowser.OpenSingleFile("Open File", "", "");
    Unity is suspended while FB is open, this means, the execution will continue after you closed the dialog. Therefor, no trigger is needed right now.
    You could also try the async calls, but they are experimental atm.

    I hope this gets you further.


    Cheers
    Stefan
     
    JadsonAlmeida likes this.
  11. raulprofe

    raulprofe

    Joined:
    Jul 27, 2017
    Posts:
    2
    Thank you very much. Just what I needed. I undestand now that really this asset is easy to use and works great. I had shipwrecked
    in the documentation so extensive that has the asset. I miss a documentation easy for dummies.
    Thank you very much again.
     
  12. MatsuImg

    MatsuImg

    Joined:
    Jul 11, 2017
    Posts:
    9
    Hi,

    When ExtensionFilter[] is set to SaveFile(), only its first element is valid. (In the application for Windows 10.)
    When ExtensionFilter[] is set to OpenFiles(), it works without problems.

    Even if I edit FileBrowser/Demo/Scripts/Examples.cs and use it, ExtensionFilter[] does not work well with SaveFile().
    Is there a better way to specify multiple extensions with SaveFile()?

    Thank you
     
  13. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    This is a limitation of the Unity editor. This won't happen in the build!


    Cheers
    Stefan
     
    MatsuImg likes this.
  14. MatsuImg

    MatsuImg

    Joined:
    Jul 11, 2017
    Posts:
    9
    Hi,

    As you said, there were no problems with the built apps!

    I seem to have jumped to the conclusion.
    I'm thankful for your kind advice.

    Thank you very much!
     
    Stefan-Laubenberger likes this.
  15. jestermaximusJr

    jestermaximusJr

    Joined:
    Jan 12, 2013
    Posts:
    12
    Hello, love your asset but I've encountered a problem. When I compile my small project (using/targeting osx) and run it, if I try to load a file and the path contains a folder with a space in the name, the path your asset returns replaces the space with '%20.' This substitution messes up any attempt to load the file at that path. Strangely, this doesn't happen when I run my project in the editor (haven't tried it on Windows). Am I missing something? Thank you!
     
  16. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    We will fix that in the next release.
    Meanwhile, just use the string method "Replace" like:
    Code (CSharp):
    1. myFile = myFile.Replace("%20", " ");
    I hope this helps you further.


    Cheers
    Stefan
     
  17. Histoveram

    Histoveram

    Joined:
    May 9, 2018
    Posts:
    2
    Hi Stefan,

    I'm having trouble with the SaveFile() feature. I have tried to use it as follows:
    Code (CSharp):
    1. public static string SaveFile()
    2.     {
    3.         string extensions = "hproj";
    4.  
    5.         string path = FileBrowser.SaveFile("Save File", "", "newproject", extensions);
    6.  
    7.         HistoLogger.InfoLog("FileManager", "Saving file: " + path);
    8.         return path;
    9.     }
    ... but "path" returns an empty string and the created file is a ghost (only appears in Windows Explorer Quick Access but nowhere else and I get an error saying "File cannot be found" when trying to open it.

    I'm using the OpenFile() feature quite the same way and it works fine:
    Code (CSharp):
    1.  
    2. public static string OpenSingleFile(string extension)
    3.     {
    4.         string path = FileBrowser.OpenSingleFile("Open File", "", extension);
    5.  
    6.         HistoLogger.InfoLog("FileManager", "Opening file: " + path);
    7.         return path;
    8.     }
    Am I doing something wrong?
    Thank you

    [Edit] I'm using Unity 2017.4.2f2 and File Browser v1.2.2
     
    Last edited: Jun 18, 2018
  18. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    I'm not sure what you're trying to do. The "SaveFile"-method doesn't create a file, it only returns the path of your desired file location. You have to create the file on your own.
     
  19. oLDo

    oLDo

    Joined:
    Mar 14, 2017
    Posts:
    53
    Stefan-Laubenberger likes this.
  20. Histoveram

    Histoveram

    Joined:
    May 9, 2018
    Posts:
    2
    Aaah ok my mistake I thought the method was creating a new file.
    Thank you for answering
     
    Stefan-Laubenberger likes this.
  21. daniel_virgen

    daniel_virgen

    Joined:
    Nov 6, 2016
    Posts:
    1
    Es funktioniert super, Vielen Dank!
     
    Stefan-Laubenberger likes this.
  22. dileepcc

    dileepcc

    Joined:
    Mar 27, 2017
    Posts:
    2
    Your plugin worked well with Windows but i'm getting following error in Mac.

    DllNotFoundException: FileBrowser
    at (wrapper managed-to-native) Crosstales.FB.Wrapper.FileBrowserMac:DialogOpenFilePanel (string,string,string,bool)
    at Crosstales.FB.Wrapper.FileBrowserMac.OpenFiles (System.String title, System.String directory, Crosstales.FB.ExtensionFilter[] extensions, Boolean multiselect)

    Things i tried:

    1. Your Mac build is working fine. (https://www.crosstales.com/media/data/assets/FileBrowser/downloads/FileBrowser_mac.zip)
    2. I created the build from your sample code. Here also Mac is giving above error.
     
  23. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    You have to build for 64bit macOS.
    We re-added support of 32bit in the upcoming release.


    Cheers
    Stefan
     
  24. Anton-Argunov

    Anton-Argunov

    Joined:
    May 2, 2014
    Posts:
    6
    Hello, I have erros with Internal.FileBrowserWindowsNative.

    Assets/PygmyMonkey/FileBrowser/Scripts/FileBrowserWindows.cs(28,13): error CS0103: The name `Internal' does not exist in the current context
     
  25. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
  26. Anton-Argunov

    Anton-Argunov

    Joined:
    May 2, 2014
    Posts:
    6
    upps...sorry
     
  27. mwaller_RM

    mwaller_RM

    Joined:
    Jul 1, 2014
    Posts:
    7
    Hi Stefan, your plugin seems to work great, thanks for much for creating it!

    For a new feature have you considered adding message box support as well? 2 button or 3 button.
     
  28. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    I'm glad FB seems useful for you!

    About the new message boxes: I will think about it, but I can't promise anything right now. We have a lot to do with our other assets, but I keep it in my mind.


    So long,
    Stefan
     
  29. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    208
    Hey Stefan,

    Love your products we own pretty much all your pro assets :) One thing that would be awesome is a file picker for mobile devices too (Android/iOS) and Linux. Maybe ever a Pro version that would include these platforms would be brilliant!

    All the best buddy,

    Justin
     
    Stefan-Laubenberger likes this.
  30. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi Justin

    Thank you for your kind words!

    Indeed, we already planned to release a PRO version for all environments. The hardest part, imho UWP, works :)
    However, we need some time to finish and test it, so don't expect it before the end of the year.


    Cheers
    Stefan
     
  31. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    208
    That's fantastic!

    Well if you would like some battle testing of Android or iOS let me know. I'd love to get my hands on it as the others out there are a bit shonky and we don't have time to code it ourselves with our busy schedule lol :)
     
  32. JadsonAlmeida

    JadsonAlmeida

    Joined:
    Jan 30, 2014
    Posts:
    7
    Awesome!
    Sample of use:
    Code (CSharp):
    1. string path = FileBrowser.OpenSingleFile("Open File", "",
    2.                 new ExtensionFilter[] { new ExtensionFilter("Image Files", new string[] { "jpg", "png" }) });
     
    Stefan-Laubenberger likes this.
  33. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,044
    I'm new using this asset. I update to 2018.4 and using Unity2018.2.16. I send you an email with the warning that is trigger when I build the scene. Maby is triggered by a .dll?
     
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    I've sent you an email.
     
  35. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    242
    Hi.

    I am getting an error when i build my app (2018.3 , windows standalone)
    ArgumentException: The Assembly Mono.WebBrowser is referenced by System.Windows.Forms ('Assets/crosstales/FileBrowser/Native/Windows/System.Windows.Forms.dll'). But the dll is not allowed to be included or could not be found.

    I tried a few different build settings, but i can't get rid of the error.
    Any idea what is wrong?
     
  36. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    Please rename the "System.Windows.Forms.dll" to "System.Windows.Forms_unity.dll" and try again.
    It will produce a warning, but it should work in the build.

    Please let me know if it helps.


    So long,
    Stefan
     
  37. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    242
    Just tried a build, but that error is still there.
     
  38. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    But does the build work?
     
  39. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    242
    No it doesn't.
    I get 3 errors. First one i posted. Second says that the build failed.
    To be complete :
    ArgumentException: The Assembly Mono.WebBrowser is referenced by System.Windows.Forms ('Assets/Plugins/crosstales/FileBrowser/Native/Windows/System.Windows.Forms_unity.dll'). But the dll is not allowed to be included or could not be found.
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:150)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
    UnityEditor.AssemblyHelper.AddReferencedAssembliesRecurse (System.String assemblyPath, System.Collections.Generic.List`1[T] alreadyFoundAssemblies, System.String[] allAssemblyPaths, System.String[] foldersToSearch, System.Collections.Generic.Dictionary`2[TKey,TValue] cache, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:156)
    UnityEditor.AssemblyHelper.FindAssembliesReferencedBy (System.String[] paths, System.String[] foldersToSearch, UnityEditor.BuildTarget target) (at C:/buildslave/unity/build/Editor/Mono/AssemblyHelper.cs:190)
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    Build completed with a result of 'Failed'
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)

    UnityEditor.BuildPlayerWindow+BuildMethodException: 3 errors
    at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (UnityEditor.BuildPlayerOptions options) [0x00234] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:190
    at UnityEditor.BuildPlayerWindow.CallBuildMethods (System.Boolean askForBuildLocation, UnityEditor.BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:96
    UnityEngine.GUIUtility:processEvent(Int32, IntPtr)
     
  40. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Unity changed something:
    https://feedback.unity3d.com/sugges...dlls-and-let-us-decide-if-we-want-to-use-them

    I try to find a solution, but it seems not an easy task.


    Edit:
    What's your compatibility-level? Try to use 4.x
     
  41. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    242
    Okay, thank you for looking in to it.

    I have tried just about all possible settings. Including 4.x
     
  42. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    We've just got another customer with the same issue.
    This are his settings and he was able to build and run it successfully:
    FB_Settings.png

    Please check the settings on your side.
     
  43. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    242
    I tried another build and it works!
    I was sure i tried every combination, but it turns out building with IL2CPP with .NET4.x causes my error.

    Mono fails with .NET Standard 2.0 and builds with .NET4.x
    IL2CPP fails in all cases.

    Thanks for the help!
     
    Stefan-Laubenberger likes this.
  44. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    1,044

    Using Unity 2018.3 or later change API Compatibility Level to: .NET 4.x

    As I mention in the email 2018.3 fail to compile.
    I updated to FileBrowser 2019.1 and I'm using Unity 2018.3.2 Windows10 64
    Scripting Run Time: .NET 4.x Equivalent (Unity 2018.3 Default)
    Scripting Backend: Mono (Unity 2018.3 Default)
    API Compatibility Level: .NET Standard 2.0 (Unity 2018.3 Default)
    Works well in the editor but when I try a build also this new version fails.


    In a new empty project (Unity 2018.3) I import the FileBrowser from the asset store.
    A warning appears in the console:

    Stefan, I try to make a build of your default demo scene and also got the same error.
    I understand that is a free version thanks, but please find time to make it work.
    Clearly, the new update did not fix the problem and introduce a Pro vr.?

    upload_2019-1-24_16-42-15.png
    In the FileBrowser folder there is README.txt file:
    But I change the
    API Compatibility Level: .NET 4.x

    and then I make a [ Build ] a warning pops in the console and :

    Conclusion: Using Unity 2018.3 or later change API Compatibility Level: to .NET 4.x
    README file need fixing.
     
    Last edited: Jan 24, 2019
    Stefan-Laubenberger likes this.
  45. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi Alan

    Thank you for mention this!
    We will fix this in the upcoming release 2019.2.


    So long,
    Stefan
     
  46. gromtron

    gromtron

    Joined:
    Nov 22, 2015
    Posts:
    5
    Do you support il2cpp builds?

    Thanks.
     
  47. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hi

    IL2CPP doesn't work under Windows but all other platforms are supported.


    Cheers
    Stefan


    Edit:
    The PRO supports IL2CPP under Windows
     
    Last edited: Apr 18, 2019
  48. gromtron

    gromtron

    Joined:
    Nov 22, 2015
    Posts:
    5
    Unfortunately we need a browser for Windows, MacOS and Linux. Do you see any chance to support il2cpp on Windows standalone in the future or is it impossible in principle?

    Thanks
     
  49. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,250
    Hello again

    This is mainly a problem of Unity - we can't do much until IL2CPP works better under Windows. :(
    But we're looking forward to improve it, but we can't do much atm.


    Cheers
    Stefan


    Edit:
    The PRO supports IL2CPP under Windows
     
    Last edited: Apr 18, 2019
  50. gromtron

    gromtron

    Joined:
    Nov 22, 2015
    Posts:
    5
    Hi Stefan,

    Thanks for rapid answer. Another question: What is about the Pro Edition? The link on Asset Store points to an error page...

    Thanks