Search Unity

  1. Unity 2018.3 is now released.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We've updated our Terms of Service. Please read our blog post from Unity CTO and Co-Founder Joachim Ante here
    Dismiss Notice
  4. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

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,057
    Dear developers

    We've just released our FREE asset File Browser to the store.

    File Browser is a simple wrapper for native file dialogs on Windows, macOS and Linux.

    Features:

    • Works with Windows, macOS and Linux in editor and runtime
    • 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!
    • Compatible with Unity 5.6 – Unity 2019
    • Full C# source code!

    Some impressions:
    01-Singlefile.PNG

    02-Multifiles.PNG

    03-folders.PNG

    04-savefile.PNG

    AssetStore:
    Free edition

    Our other assets


    Demos:
    Windows
    Mac



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


    Cheers
    Stefan
     
    Last edited: Jan 14, 2019 at 3:43 PM
  2. hasanbayat

    hasanbayat

    Joined:
    Oct 18, 2016
    Posts:
    520
    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,057
    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. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    The version 1.0.0 is at the store!

    Happy time! :);):p
     
  5. 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
     
  6. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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:

  7. 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.
  8. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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
     
  9. 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.
  10. 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!!!
     
  11. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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.
  12. 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.
     
  13. 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
     
  14. Stefan-Laubenberger

    Stefan-Laubenberger

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

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


    Cheers
    Stefan
     
    MatsuImg likes this.
  15. 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.
  16. 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!
     
  17. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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
     
  18. 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
  19. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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.
     
  20. oLDo

    oLDo

    Joined:
    Mar 14, 2017
    Posts:
    51
    Stefan-Laubenberger likes this.
  21. 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.
  22. daniel_virgen

    daniel_virgen

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

    dileepcc

    Joined:
    Mar 27, 2017
    Posts:
    1
    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.
     
  24. Stefan-Laubenberger

    Stefan-Laubenberger

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

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


    Cheers
    Stefan
     
  25. 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
     
  26. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
  27. Anton-Argunov

    Anton-Argunov

    Joined:
    May 2, 2014
    Posts:
    6
    upps...sorry
     
  28. 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.
     
  29. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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
     
  30. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    206
    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.
  31. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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
     
  32. SketchWork

    SketchWork

    Joined:
    Jul 6, 2012
    Posts:
    206
    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 :)
     
  33. 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.
  34. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    We've just released version 2018.4.0 of FB. Changes:
    • Async-methods currently disabled
    • Updated to Common 2018.4.0
     
  35. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    The new version is in the store!
     
  36. AlanMattano

    AlanMattano

    Joined:
    Aug 22, 2013
    Posts:
    920
    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?
     
  37. Stefan-Laubenberger

    Stefan-Laubenberger

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

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    164
    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?
     
  39. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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
     
  40. sylon

    sylon

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

    Stefan-Laubenberger

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

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    164
    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)
     
  43. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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
     
  44. sylon

    sylon

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

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

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    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.
     
  46. sylon

    sylon

    Joined:
    Mar 5, 2017
    Posts:
    164
    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.
  47. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    We've just released version 2019.1.0 of FB. Changes:
    • Linux support added!
    • macOS library improved
    • Updated to Common 2019.1.0
     
  48. Stefan-Laubenberger

    Stefan-Laubenberger

    Joined:
    May 25, 2014
    Posts:
    1,057
    The new version is already in the store.
    This was incredible fast, thanks Unity! :)