LocalFileToDataUrl Op
load a local file and output as data url
Summary (oneliner)
Let the user select a file from their local harddrive. The file is not loaded to any server, it is just loaded in to memory. You can connect the dataUrl output to a texture op to load an image as a texture in cables.
Internally it uses an <input type="file"/>
, the way standard html file select
Accept Parameter
- A valid case-insensitive filename extension, starting with a period (".") character. For example:
.jpg
,.pdf
, or.doc
- Multiple extensions seperated by comma, like
.png,.jpg
- A valid MIME type string, with no extensions.
- The string
audio/*
meaning "any audio file". - The string
video/*
meaning "any video file". - The string
image/*
meaning "any image file".
Full Name
- Ops.Sidebar.LocalFileToDataUrl
- Core Op - Official cables op
- MIT
Documentation (markdown)
Issues
Example patch id
Youtube ids (comma seperated)
Op Licence
Caniuse query
Example Patch example LocalFileToDataUrl
INPUT PORTS
link (Object)
Text (String)
Button Text (String)
Accept Files (String)
Allow Multiple Files (Number: boolean)
Id (Number: string)
Visible (Number: boolean)
Grey Out (Number: boolean)
Show Dialog (Trigger)
Reset (Trigger)
OUTPUT PORTS
childs (Object)
Data URL (String)
Filename (String)
File Object (Object)
File Select Button now shows Filename when a file was selected
Num Files (Number)
Data URLs (Array)
Filenames (Array)
File Changed (Trigger)
Patches using LocalFileToDataUrl
Changelog
created op | pandur - 2020-08-19 12:11 | |
Ops.User.pandur.LocalFileToDataUrl renamed to Ops.Sidebar.LocalFileToDataUrl | pandur - 2020-08-19 15:26 | |
react properly to disconnecting parent | stephan - 2022-02-03 12:34 | |
feature | added input field for button text | pandur - 2024-01-23 09:07 |
feature | File Select Button now shows Filename when a file was selected | pandur - 2024-02-02 10:41 |
feature | Added Accept input to filter accepable files by extension | pandur - 2024-02-02 10:50 |
feature | Added Option to select multiple files at the same time | pandur - 2024-02-07 16:17 |