File Attachments
File attachment library.
How to use
Copy-paste the following <script> near the end of your pages under JS Implementing Plugins to enable it.
<script src="../node_modules/hs-file-attach/dist/hs-file-attach.min.js"></script>
Copy-paste the init function under JS Plugins Init., before the closing </body> tag, to enable it.
<script>
$(document).on('ready', function () {
// INITIALIZATION OF CUSTOM FILE
// =======================================================
$('.js-file-attach').each(function () {
var customFile = new HSFileAttach($(this)).init();
});
});
</script>
Custom file input
Custom file btn
Avatar uploader
Custom file boxed
Modal example
Methods
| Parameters | Description | Default value |
|---|---|---|
|
|
Supported file types. If empty all supported. | [] |
|
|
Max size for uploading file. | 1024 |
|
|
Supported two mods (image/simple). image - show image after uploading. simple - show file name after uploading. | simple |
|
|
Element selector with src for image mode. |
null |
|
|
Element selector for simple mode. |
null |
|
|
Element selector to reset form. | null |
|
|
Error message text if the file size is larger than the allowed. | 'File is too big!' |
|
|
Error message text if file type is not supported. | 'Unsupported file type' |