GithubHelp home page GithubHelp logo

kristofferstrube / blazor.filesystem Goto Github PK

View Code? Open in Web Editor NEW
26.0 2.0 3.0 14.39 MB

A Blazor wrapper for the File System browser API.

Home Page: https://kristofferstrube.github.io/Blazor.FileSystem/

License: MIT License

C# 98.73% JavaScript 1.27%
blazor blazor-jsinterop blazor-webassembly csharp editor file-system file-system-api filesystem filesystemapi github-pages

blazor.filesystem's Introduction

Kristoffer Strube

I'm currently working on using Blazor Web Apps to work with the browser easily and safely.

Right now, I'm focusing on wrapping the Web Audio API and its surrounding API's in my Blazor.WebAudio and Blazor.MediaCaptureStreams projects.

My Blog: https://kristoffer-strube.dk

I also do consultancy primarily focused on Blazor. If you are interested in my services, just contact me on Twitter or LinkedIn. Jobs related to my open-source projects get a considerable rebate.

Contact

Twitter ๐Ÿค: @KStrubeG

LinkedIn ๐Ÿ‘”: KristofferStrube

Mastodon ๐Ÿ˜: @KristofferStrube

BlueSky ๐Ÿฆ‹: @kstrubeg.bsky.social

blazor.filesystem's People

Contributors

kristofferstrube avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

amcvoy awad19977

blazor.filesystem's Issues

Casting between `FileSystemHandleInProcess` and `FileSystemFileHandleInProcess` or `FileSystemDirectoryHandleInProcess` is not possible.

When we get all the entries of a directory using the ValuesAsync method of FileSystemDirectoryHandleInProcess it currently returns an array of FileSystemHandleInProcess. As the current inheritance hierarchy is we can't cast each entry to either a FileSystemFileHandleInProcess or a FileSystemDirectoryHandleInProcess as they don't inherit from it.
The following is our current inheritance tree:

  graph LR;
  subgraph Blazor Server Supported
    FileSystemHandle
    FileSystemFileHandle
    FileSystemDirectoryHandle
  end
  subgraph Blazor WebAssembly Only
    FileSystemHandleInProcess
    FileSystemFileHandleInProcess
    FileSystemDirectoryHandleInProcess
  end
  FileSystemFileHandle--->FileSystemHandle
  FileSystemDirectoryHandle--->FileSystemHandle
  FileSystemHandleInProcess--->FileSystemHandle
  FileSystemFileHandleInProcess--->FileSystemFileHandle
  FileSystemDirectoryHandleInProcess--->FileSystemDirectoryHandle

We would ideally have FileSystemDirectoryHandleInProcess inherit from both FileSystemDirectoryHandle and FileSystemHandleInProcess and the same should apply to the file handle.

A solution to this is to use interfaces. If we add two interfaces then the desired cast should be possible, but we will need to change what is returned for a few methods.

  graph LR;
  subgraph Blazor Server Supported
    FileSystemHandle
    FileSystemFileHandle
    FileSystemDirectoryHandle
    IFileSystemHandle
  end
  subgraph Blazor WebAssembly Only
    FileSystemHandleInProcess
    FileSystemFileHandleInProcess
    FileSystemDirectoryHandleInProcess
    IFileSystemHandleInProcess
  end
  FileSystemFileHandle--->FileSystemHandle
  FileSystemDirectoryHandle--->FileSystemHandle
  FileSystemHandleInProcess--->FileSystemHandle
  FileSystemFileHandleInProcess--->FileSystemFileHandle
  FileSystemDirectoryHandleInProcess--->FileSystemDirectoryHandle
  FileSystemHandle-.->IFileSystemHandle
  IFileSystemHandleInProcess-.->IFileSystemHandle
  FileSystemHandleInProcess-.->IFileSystemHandleInProcess
  FileSystemFileHandleInProcess-.->IFileSystemHandleInProcess
  FileSystemDirectoryHandleInProcess-.->IFileSystemHandleInProcess

WriteBlobWriteParams could not be found (even doe the js was loaded)

I was trying to adjust the WriteAsync functions a little (adding a write for a DotNetStreamReference) and stumbled over the fact, that my method added to the js file wasn't found. Same goes for the existing version using "WriteBlobWriteParams".

Am I doing something wrong? Was it tested, cause there is no example using the above.
Could it reference a different IJSObjectReference?

The file is loaded as of what I see in the Devtools sources tab, but I receive an error msg:

Microsoft.JSInterop.JSException: Could not find 'WriteBlobWriteParams' ('WriteBlobWriteParams' was undefined).
blazor.webassembly.js:1 Error: Could not find 'WriteBlobWriteParams' ('WriteBlobWriteParams' was undefined).

Thanks for your reply

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.