
Research
Security News
Malicious PyPI Package Exploits Deezer API for Coordinated Music Piracy
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
@superhawk610/file-select
Advanced tools
Minimalist file/folder selection interface that includes Node/Express integration or works standalone.
Minimalist file/folder selection interface that includes Node/Express integration or works standalone.
npm install @superhawk610/file-select
Once you have installed the module via NPM, make sure to include the scripts and styles. You can either manually copy them from the /dist
folder, or have them served for you if you are using Express via the included middleware (see Usage).
Requires jQuery 3.x or higher
Include the .js and .css files for the plugin. If you are manually copying them, link to wherever they are being served. If you are using Express, link to select.min.css
and select.min.js
as though they were at the root directory and they will be served by the included middleware.
<link rel="stylesheet" href="select.min.css">
...
<script type="text/javascript" src="select.min.js">
Simply call .fileSelect()
on any div on your page to have it converted to a file select popup. Call it with the argument 'show' or 'hide' to have it displayed or hidden.
$('#myFileSelect').fileSelect()
$('#myFileSelect').fileSelect('show')
To get the user's selection from the interface, bind to the sfs.submit
event fired by the element you called fileSelect()
on. This event will return an Object array, each containing the name, type, and full path of each file selected. Here's an example:
$('#myFileSelect').on('sfs.submit', function(event, files) {
console.log(files[0].name) // 'words.txt'
console.log(files[0].type) // 'dir' or 'file'
console.log(files[0].path) // '/home/user/words.txt'
})
The file select will need a data source. Currently, only the included Express middleware is available, but a future update will add the ability for custom data sources. In your Express app, include the following lines:
var fileSelect = require('@superhawk610/file-select')
app.use(fileSelect())
You will likely want to include this before any calls to express.static
just so the middleware has precedence when serving its styles and scripts.
By default, your home directory is used as the starting directory when the modal is shown. If you would like to start at a different directory, specify it when activating the middleware, like so:
app.use(fileSelect({
path: '/var/www'
}))
Be aware that this interface will expose your server's full file listing to any page on which it is visible. Use at your own risk.
FAQs
Minimalist file/folder selection interface that includes Node/Express integration or works standalone.
We found that @superhawk610/file-select 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.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.
Security News
Newly introduced telemetry in devenv 1.4 sparked a backlash over privacy concerns, leading to the removal of its AI-powered feature after strong community pushback.