GithubHelp home page GithubHelp logo

unitysimplefilebrowser's Issues

Suggestion: accept full paths in filename input field

In the native Windows file dialog, if you type a full path in the filename input field instead of just a filename, it will follow the full path and open the file. But in the current version of SimpleFileBrowser, if you do this, the field just turns red and nothing happens. I think this feature would be very useful, because it allows the user to copy a file's full path on Windows Explorer (Shift+Right Click, Copy as path), paste it directly on SimpleFileBrowser, and press Enter to open it right away.

Example of expected behavior:

  • Open Load dialog at some random directory, e.g. C:\, with PickMode.Files.
  • Write "C:\dir1\dir2\file.txt" (with or without quotes) on the filename input field and press Enter or click Select.
  • The file is selected and onSuccess is invoked as usual.

The native Windows dialog goes even further, and if you write a dir path, it changes the current dir to that dir, and it even accepts relative paths. But I imagine that's more effort. There's also the question of what the behavior should be for PickMode.Folders, and FilesAndFolders. I would already be very thankful just for absolute paths in the Load dialog for .Files.

Not working perfectly in iOS

Description of the bug

In iOS, files are not showing as expected. Some folders are showing, but not regular folders like photos or users folder.

Also, it's possible to create a folder from the runtime, but it's not found in the iPhone default file browser.

Reproduction steps
Used the following code in a coroutine -

  FileBrowser.SetFilters(true, new FileBrowser.Filter("Image", ".jpg", ".png", "public.image"), new FileBrowser.Filter("PDF", ".pdf"));
  FileBrowser.SetDefaultFilter(".png");

  yield return FileBrowser.WaitForLoadDialog(FileBrowser.PickMode.Files, false);

  if (FileBrowser.Success)
  {
      string filePath = FileBrowser.Result[0];
      Debug.Log("File Path - " + filePath);
      //my codes here
  }

Result-
issue_ios
issue_ios2

Platform specs

  • Unity version: 2019.4.7f1
  • Platform: iOS
  • Device: IPhone 12 Pro Max ver. 14.5
  • Target Min iOS Version: 11
  • How did you download the plugin: GitHub

Browser is letting clicks through and interacting with background UI

Description of the bug

Browser is letting clicks through its frame as long as there is no UI element (like buttons, or the file-list-element). It happens that you accidentally click on buttons behind the browser.

Reproduction steps

Create a scene with a canvas. Add two buttons (one to open browser, one to check if it gets clicked through the browser).
Add sample script from github and change the start function to a public function to open the browser on click.

Platform specs

  • Unity version: 2019.4.22f1
  • Platform: Android
  • Device: Samsung Galaxy S10e on Android 11 & Unity Play Mode
  • How did you download the plugin: Unity AssetStore

Change aspect

Is possible to change the aspect of the file picker? Like increase size to make it more readable on little screens

don´t return nothing on load button clicked

using the base code i can't pass from "yield return FileBrowser.WaitForLoadDialog( false, true, null, "Load File", "Load" );", not even the debug return a message, i'm using the version in the asset store

File manager slows down.

Hello! I have a little problem: on some computers file manager slows down and opens directories for a long time (even on computers with ssd), but on most others it works good(even on computers with hard drive)(windows). What could be the problem? Thank you in advance.

Using a custom canvas for FileBrowser on Android 10

I am trying to figure out if I can use a custom canvas instead of having to call ShowLoadDialog on Android 10. I have been developing an application for quite some time now and have been using this great browser on other platforms. In my app I set up a custom canvans to place the file browser window in a specific area on the screen. To open the file browser canvas I used to just activate and deactivate the Canvas GameObject during runtime and this still works on Windows Platforms. On Android 10 however, if i try to use my custom canvas, when I activate the gameobject I get no file listings and the quick links is blank. I tryid a simple test on Android by calling ShowLoadDialog instead of my custom canvas and the browser does give me the file listings and quick links shows primary drive. Is there a way to get the file listings to show up on Android 10 without having to call ShowLoadDialog as it works on Windows?

Filepath working on Windows but failing on Android

The FileBrowser was working fine until a few days, but since a few commits the android filepath seems to be wrong:
content://com.android.externalstorage.documents/tree/primary%3ADCIM/document/primary%3ADCIM%2FScreenshots%2Fphoto.jpg

When I test in Unity 2019 and upload files via Windows everything seems to be fine. The path comes from the ShowLoadDialogCoroutine directly. It doubles the path for some reason. I did not change anything in the filebrowser i believe. Anyone had some similar issues?

Out of memory error when getting audio file result

Hello and thank you for the great tools!

I'm getting a random out of memory error from line 341 of FileBrowserHelpers.cs
return File.ReadAllBytes(sourcePath);

It appears it is called through me using if (FileBrowser.Success)

It happens randomly when loading audio files- file sizes from 1 megabyte to 50 megabytes will randomly get this error. The same audio file will randomly get the error if loaded in multiple times. Any idea on a direction for me to go to resolve this? Thank you for your time.

Exception - UnityEngine.AndroidJavaException: java.lang.ClassNotFoundException: com.yasirkula.unity.FileBrowserPermissionReceiver

I am getting the above error when using the example code provided. The exception is hit when running the yield return FileBrowser.WaitForLoadDialog(false, true, null, "Load File", "Load");

It is worth noting that the same works when I test on desktop, but when I build this and run on my Android phone (Note 10), it hits this error.

Can you please advise on what I could do to overcome this issue?

Simple File Browser - Click & Head Tracking

Description of the bug

Dear Sir,
I am using your "simple file browser" for my VR project. Actually, it's working well but there is something that I did not get it.
I can select the files from the list but i cannot click them. I can interact with all the buttons in my interface, but I cannot click the files in the file list. In addition, my oculus rift headset acting like a pointer when I'm on the file list panel. While I moving my head from up to down or vice versa I can select the files like my pointers.

Reproduction steps

-changing the canvas render mode "overlay to wordspace.

  • using oculus rift SDK with VRTK

Platform specs

  • Unity version: * 2019.3.10*
  • Platform: Windows
  • How did you download the plugin: * Asset Store*

Screenshot
ss

Audio Not Played on Android

first of all thank you for this great plugin.
i have a problem and that is i want to pick a mp3 file from my local storage(from device) and then using audiosource i want to play it.
i have done this using this script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.IO;
using UnityEngine.UI;
using System.Runtime;
using System.Runtime.InteropServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Serialization;
using NAudio;
using NAudio.Wave;
using UnityEngine.Networking;
using SimpleFileBrowser;
public class ReadMp3 : MonoBehaviour
{
private AudioSource audioSource;
public Text pathText;

private void Start()
{
    audioSource = GetComponent<AudioSource>();
}
public void ReadMp3Sounds()
{
    FileBrowser.SetFilters(false, new FileBrowser.Filter("Sounds", ".mp3"));
    FileBrowser.SetDefaultFilter(".mp3");
    StartCoroutine(ShowLoadDialogCoroutine());
}
IEnumerator ShowLoadDialogCoroutine()
{
    yield return FileBrowser.WaitForLoadDialog(false, null, "Select Sound", "Select");
    pathText.text = FileBrowser.Result;
    if (FileBrowser.Success)
    {
        byte[] SoundFile = FileBrowserHelpers.ReadBytesFromFile(FileBrowser.Result);
        yield return SoundFile;
        audioSource.clip = NAudioPlayer.FromMp3Data(SoundFile);
        audioSource.Play();
    }
}

}

in this script i used NAudio.dll file to accomplished it.
now my problem is that i successfully play audio song from my computer but when i build it for android all things worked properly(i could select mp3 from my android device),but the song was didn't played.
can you please tell me how can i do that for android or i made any mistake or something.

Images Thumbnails

How to display images thumbnails instead of nice icons that exist now so the user can see what he is choosing from?

Issue with Unity 2017.3.0

Hi,

I love your code and I used it for 5.6 but when I upgraded unity to the latest one, when I use your plugins it does not show all files in a folder. Because of that, the plugin is unusable.

InputSystem does not exist in the namespace

Description of the bug

Filebrowser.cs(10,19): error CS0234: the type or namespace name 'InputSystem' does not exist in the namespace 'UnityEngine'.

Also happens in FileBrowserDeleteConfirmationPanel and FileBrowserRenamedItem.

Reproduction steps

I just downloaded and imported SimpleFileBrowser into my project. And it is generating these errors. I am using the latest InputSystem since I need to using some keypresses as input to my unity project.

Platform specs

Please provide the following info if this is a Unity 3D repository.

  • Unity version: 20194.12f1
  • Platform: Mac OS BigSur
  • Device: NA Macbook Pro 2016 with touchbar
  • How did you download the plugin: Package Manager

Additional info

NA

Thank you and have a nice day!

[Help wanted]

How to add default name when open dialog save file ?
Ths so much

Platform specs

  • Unity version: e.g. 2019.3.9f1
  • Platform: Windows 10
    .

UWP compatibility

At the moment I am trying to build a project including the file browser to UWP, but I get errors. I can not use Environment.SpecialFolder (and some more functionalities in this class) which seems to be not included in UWP. Maybe there is a quick fix. For today I will just try to include the UWP file browser. Of course it would be cool, if this file browser could do this too.

Select file or folder

Is it possible to select either a file or a folder using the ShowLoadDialog? if i folder mode to true then I can't select a file even if I provide filters

File & folder name is incorrect on Korean

Description of the bug
Screen Shot 2021-01-19 at 12 43 40 AM
Screen Shot 2021-01-19 at 12 43 50 AM

"부산시" <= That's folder name.

Platform specs

  • Unity version: 2019.04.18f
  • Platform: MAC
  • Device: Mac OS
  • How did you download the plugin: Asset Store

Android can't view storage

I'm not sure whether the culprit is my phone or a bug in SimpleFileBrowser but I suspect the Android. I need help to be able to use the asset.

Android 9. At the start of the app I use CheckPermissions() which returns "Denied". I then use RequestPermissions() and re-check. It again says "Denied". Android app permissions says no permissions are requested.
The Load window left panel shows "Primary Drive" with the right one empty. Also tapping/double tapping "Primary Drive" does nothing. Still, an "up" button is present that when tapped twice it shows in the right panel: a numbered folder, "emulated", "enc_emulated" and "self". All are empty.

Android 10 Android app permissions says no permissions are allowed and no permissions are denied and CheckPermissions() returns "Denied" and after RequestPermissions() it's still "Denied". But after that, the Load window requested access to "Downloads" then to other locations as I browsed. These permissions are apparently saved from session to session but a new session start still shows "Denied".

How can I make it work on Android 9?

Access Denied when using folder ?

Hey. This is a fantastic plugin. Thanks a lot for making it.

I've been trying to get this to work all day. I get an access error every time i try to load a folder. Apologies in advance, it's probably super simple.

When I use

This method:
yield return FileBrowser.WaitForLoadDialog( FileBrowser.PickMode.FilesAndFolders, true, null, null, "Load Files and Folders", "Load" );

I get the following error when opening a folder:

UnauthorizedAccessException: Access to the path 'and insert path here' is denied;

I've tried using the folders only option, but it yields the same result.

I then tried using your other method

FileBrowser.ShowLoadDialog( ( paths ) => { Debug.Log( "Selected: " + paths[0] ); },
								   () => { Debug.Log( "Canceled" ); },
								   FileBrowser.PickMode.Folders, false, null, null, "Select Folder", "Select" );

But my issue here is that I can't figure out how to read paths[0] afterwards. I tried using OnSuccess but I have no idea how to get the value out of that either.

Hope you can help. An example would be great. Thanks in advance.

QuickLinks initialised before permission grant on Android

Hello, first of all I love your asset and thank you for opensourcing it.
I think I discovered a little bug.

On Android, you need to ask for the READ_EXTERNAL_STORAGE permission to access, for example, the content of an external SD card. But, in FileBrowser.cs L.492, you call InitializeQuickLinks in the Awake function, before the user is asked for the permission to read files. Which means that the external SD card you may have, won't appear in the QuickLinks of the SimpleFileBrowserCanvas, even if the permission to access it has been given afterwards.

The bug is not blocking, since on all following app launches, if you don't revoke the permission of the app, you won't ever see it anymore. But it still would be better if it also worked the first time.

How to change color?

The file browser is great and works functionally? But some people want a dark background instead of white.

image

Any idea how we can modify the white to gray?

All I can select is folder ONLY.

OS: Android 4.4.2
CPU: RK3288
I paste the sample codes, build the apk, and install it to my system.
Dialog shows, I can switch to every folder I want, but I can't see and files.
Is that a bug?

simple file browser for vr systems

hi, is there any way to use this file browser for vr systems.
I tried some solutions,
-using a pointer instead of a mouse.
-changing the canvas render mode "overlay to wordspace."
in generally some of my applications work well, but "SimpleFileBrowserWindow" under the "SimpleFileBrowserCanvas" often cause problems.

Select multiple files

First, thanks for this awesome Asset !

Would it require a lot of work to allow selecting multiple files in a folder and obtain list of paths ?

File browser does not display files or folders in directories containing system files

The file browser does not display any files or folders when opening a directory containing a system file (such as pagefile.sys in C:\). This only seems to happen in the IL2CPP build version, rather than the Mono version (or the editor).

I made this fix in FileBrowserHelpers.GetEntriesInDirectory:

try
{
    FileSystemInfo[] items = new DirectoryInfo(path).GetFileSystemInfos();
    var entries = new List<FileSystemEntry>();

    foreach (FileSystemInfo item in items)
    {
        try
        {
            if (!item.Attributes.HasFlag(FileAttributes.System))
                entries.Add(new FileSystemEntry(item));
        }
        catch (System.Exception e) {
            Debug.LogException(e);
        }
    }

    return entries.ToArray();
}
catch (System.Exception e)
{
    Debug.LogException(e);
    return null;
}

What do you think?

Can using for webgl?

Hello,
Thank you for this support, this is pretty, but this can support browser file on PC for Webgl built.
Edit: I'll try and can not T.T

problem with vr

i'm having a little problem using this asset with oculus rift, the object SimpleFileBrowserItem in filesContainer does not response to my seted pointer, instead it responses to my main camera as a pointer (probably a problem with OnPointerEnter void, but i'm not sure)

Can't get the file path on android

The file path turns out to be empty when I select a file. The browser can access external directory's contents fine. I see all the files. But when I select them the path is empty. The same code works fine on Windows.
SimpleFileBrowser.FileBrowser.ShowLoadDialog( (path) => { uupdate(path); }, null, false, null, "Select File", "Select" );

Add an 'any supported format' filter

We have used this with great success in our Global Game Jam 2017 game Eye Can't Hear.

One question/feature request though: We want players to be able to add any supported audio file. As such, we'd like a filter to allow the player to select any file having one of the .mp3, .wav, .flac, .aiff, .ogg extensions.

An 'any supported format' filter would be greatly appreciated.

NullReferenceException on Unity 2019.4.1

Description of the bug

NullReferenceException: Object reference not set to an instance of an object
SimpleFileBrowser.RecycledListView.UpdateList () (at Assets/Plugins/SimpleFileBrowser/Scripts/SimpleRecycledListView/RecycledListView.cs:55)
SimpleFileBrowser.FileBrowser.RefreshFiles (System.Boolean pathChanged) (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1420)
SimpleFileBrowser.FileBrowser.OnShowHiddenFilesToggleChanged () (at Assets/Plugins/SimpleFileBrowser/Scripts/FileBrowser.cs:1071)
UnityEngine.Events.InvokableCall.Invoke () (at <4eca0aa85b9643a199169bb7e91fc8d3>:0)
UnityEngine.Events.UnityEvent`1[T0].Invoke (T0 arg0) (at <4eca0aa85b9643a199169bb7e91fc8d3>:0)
UnityEngine.UI.Toggle.Rebuild (UnityEngine.UI.CanvasUpdate executing) (at D:/unity/2019.4.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/Toggle.cs:130)
UnityEngine.UI.CanvasUpdateRegistry.PerformUpdate () (at D:/unity/2019.4.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/CanvasUpdateRegistry.cs:177)
UnityEngine.UI.ScrollRect:LateUpdate() (at D:/unity/2019.4.0f1/Editor/Data/Resources/PackageManager/BuiltInPackages/com.unity.ugui/Runtime/UI/Core/ScrollRect.cs:805)

Reproduction steps

FileBrowser.ShowLoadDialog((paths => {
                //todo
}), () => {
                //todo
});

Platform specs

Please provide the following info if this is a Unity 3D repository.

  • Unity version: 2019.4.1
  • Platform: Windows
  • How did you download the plugin: Asset Store version 1.3.6

Additional info

Please check Logcat (Android) or Xcode console (iOS) for any meaningful error messages and include them here.

Reopening FileBrowser in onSuccess or onCancel

When calling ShowLoadDialog or ShowSaveDialog inside one of the callback functions to open a new dialog after the first one was closed, the OnOperationSuccessful or OnOperationCanceled method immediately sets the onSucess and onCancel members to null:

	private void OnOperationCanceled( bool invokeCancelCallback )
	{
		Success = false;
		Result = null;

		Hide();

		if( invokeCancelCallback && onCancel != null )
			onCancel(); // **Open new dialog here**

		onSuccess = null; // **It breaks because the callbacks are set to null**
		onCancel = null;
	}

Removing the last two lines of the method would allow "chaining" of dialogs.

标题栏的bug

如果标题栏的路径很长,启动时设置默认路径,那么窗口显示时会隐藏后面的路径,这种体验感并不友好,我修改了下脚本解决了这个问题
pathInputField.text = m_currentPath;
pathInputField.ActivateInputField();
pathInputField.Select();
StartCoroutine(MoveTextEnd_NextFrame());

IEnumerator MoveTextEnd_NextFrame()
{
yield return new WaitForEndOfFrame() ;
pathInputField.MoveTextEnd(false);

    }

Making a confirmation panel for save file override.

Does the current package handle save file override confirmation? I see that the prefab has a delete confirmation panel, it would be nice to have a save file override confirmation panel too. Currently it's hard to check before saving since I can only get file paths when OnSuccess happens.

After loading a file Unity complains about two EventSystems in the scene

Thanks for your great asset!!

Following your code example on github, I got it working instantly. Only one question. After loading a file, Unity complains that there are two EventSystems in the scene.

How can I get rid of it? I have a Canvas and a UI and already an EventSytem in place.

Duplicate error on build

Description of the bug

We have updated to version 1.4.7 but, for some reason, we are getting an error saying we have duplicate classes on "com.yarsikula.unity.FileBrowserPermissionReceiver" and "com.yarsikula.unity.FileBrowserPermissionFragment" found in modules SimpleFileBrowser.jar and Classes.jar.
Is there a way to fix this?

  • Unity version: 2019.4.15

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.