Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
jquery-multifile
Advanced tools
MultiFile ($.MultiFile) is a non-obtrusive and crucially non-opinionated plugin for jQuery that helps your users easily select multiple files for upload.
It helps you implement a basic interface to improve the file selection experience of your users whilst providing you, the developer, with 3 simple methods of validation: accepted extensions, maximum number of files and total size.
This plugin will never deal with the server-side implementation of your upload solution. This plugin will not upload your files. If that's what you want, we recommend you check them out one of the
many,
many
many great tools out there which provide a full solution - with image previews, progress bars and extensive support for many environments (.NET
, PHP
, Java
, etc...).
And remember..... server-side validation is always required.
First, get the package
Install with bower: bower install multifile
or download zip from GitHub multifile.zip
Then, invoke the required javascript files to your document, just before the </html>
tag.
Add jQuery to your page. We strongly recommend you make use of Google's Hosted Libraries service.
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
Then add the plugin (after jQuery)
<script src="/path/to/plugin/jquery.MultiFile.min.js"></script>
Note that, before v2.2.2, the file was called jQuery.MultiFile.min.js
instead (jQuery recommended to use a lowercase ‘q’ in package names).
Just add multiple="multiple"
and class="multi"
attributes to your <input type="file"/>
, like this:
<input type="file" multiple="multiple" class="multi"/>
Use the maxlength
property if you want to limit the number of files selected.
Server-side validation is always required
<input type="file" multiple="multiple" class="multi" maxlength="2"/>
Use the accept
if you only want files of a certain extension to be selected Separate valid extensions with a "|", like this: "jpg|gif|png".
Server-side validation is always required.
<input type="file" multiple="multiple" class="multi" accept="gif|jpg"/>
Versions of HTML and xHTML prior to HTML 5 do not support the multiple="multiple"
attribute. The plugin will still work in almost the same way, but your users will only be able to one file at a time.
<input type="file" class="multi"/>
Use the maxlength
property if you want to limit the number of files selected.
Server-side validation is always required
<input type="file" class="multi" maxlength="2"/>
Use the accept
if you only want files of a certain extension to be selected Separate valid extensions with a "|", like this: "jpg|gif|png".
Server-side validation is always required.
<input type="file" class="multi" accept="gif|jpg"/>
For more examples, documentation and a full list of features available, please visit the plugin's official website.
: full build history on Travis CI
FAQs
jQuery Multiple File Selection Plugin
We found that jquery-multifile 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.