1.2.2 • Published 3 years ago

5x5_uploader v1.2.2

Weekly downloads
36
License
ISC
Repository
github
Last release
3 years ago

5x5_uploader

A Javascript uploader that creates a dropfile area, file queue, and optional input elements with very little setup.

Uses Materialize for responsive layout and alerts.

Demo page can be found here.

An alternate uploader with the same functionality but written as a jQuery plug in using Bootstrap can be found here.

Installation

Using npm;

$ npm install 5x5_uploader materialize-css@next

Using a cdn;

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
<script src="5x5_uploader.min.js"></script>

Basic Setup

<div id="uploader">
    <span id="config">
        {
            "destination": "/uploader.jsp"
        }
    </span>
</div>

Options

Options that can be specified when initializing uploader;

NameTypeDefaultDescription
destinationstringnullRequired. Path to a processing script/api
destinationParamsobjectnullKey/value pairs that can be used for creating a querystring on upload
sizeLimitinteger1Limit of individual file sizes, in MB
fileLimitinteger5Limit of total number files that can be queued for upload
selectOptsobjectnullKey/value pairs used to render a select element for each file queued for upload. Key is used for the individual option value and the key's value displayed to user. Chosen value gets appended to file object as property 'fileType'
showDescriptionbooleanfalseIf true will render a text input for each file queued for upload. Value gets appended to file object as property 'description'