
Security News
OpenGrep Restores Fingerprinting in JSON and SARIF Outputs
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
aurelia-files
Advanced tools
A simple attribute plugin for Aurelia to simplify loading files with the HTML5 FileReader
A simple aurelia attribute to allow you to load files into the browser, using the HTML5 FileReader functionality, also supports drag and drop.
with jspm
jspm install npm:aurelia-files
then
aurelia.use.plugin("aurelia-files");
You can see the code and everything in the examples folder!
A simple example of allowing a user to load a file and then callback with the (file, data) arguments:
<input type="file" id="some-file-element" files="on-loaded.bind: SomeFileLoadedCallback" />
// some VM
export class SomeVM
{
SomeFileLoadedCallback(file, data) {
// Do something with file (js file) and data (content of the file)
}
// Remember if you need to access the *this* scope use
// SomeFileLoadedCallback = (file, data) => { ... }
}
A more complicated example with custom settings:
<input id="some-files-element" files="on-loaded.bind: SomeLoadedCallback; on-progress.bind: SomeProgressCallback; on-error.bind: SomeErrorCallback, file-filter.bind: 'image.*', read-as.bind: 'binary' }" />
As shown above you can hook into any of the file loading events and get access to the data to display things like progress bars, and custom file filters, which although the accepts attribute should enforce this for you but does not currently work in all browsers. So in this case you can constrain loaded files and just ignore ones that dont match the pattern. Finally it is loading the data as a binary string in the above example, however this can be converted to use other supported types.
The available options for this binding are:
FAQs
A simple attribute plugin for Aurelia to simplify loading files with the HTML5 FileReader
The npm package aurelia-files receives a total of 11 weekly downloads. As such, aurelia-files popularity was classified as not popular.
We found that aurelia-files demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
OpenGrep has restored fingerprint and metavariable support in JSON and SARIF outputs, making static analysis more effective for CI/CD security automation.
Security News
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.