A HTML5 upload component without UI

Overview

Simple Uploader

Latest Version Build Status Coveralls David David Gitter

A HTML5 upload component which provides full control of UI styles.

Installation

Install via npm:

npm install --save simple-uploader

Install via bower:

bower install --save simple-uploader

Usage

<script type="text/javascript" src="[script path]/jquery.js"></script>
<script type="text/javascript" src="[script path]/simple-module.js"></script>
<script type="text/javascript" src="[script path]/simple-uploader.js"></script>

<input type="file" id="upload-file" />
var uploader = simple.uploader({
  url: '/upload/url'
});

$('#upload-file').on('change', function(e) {
  uploader.upload(this.files);
});

Options

url

String, required, specify the upload API url on server.

params

Hash, specify extra params which will be sent to server with file data.

fileKey

String, specify the name that server will use to get file data.

connectionCount

Number, 3 by default, specify max number of upload connection that can exist simultaneously.

Methods

upload ([File Object]/[File Element]/[File Array])

Use this method to start uploading, accept file object or input:file element or file object arrays as the only param.

cancel ([File Object]/fileId)

Cancel uploading a specific file and remove it from the upload queue.

destroy

Cancel all uploadings and destroy the component instance.

readImageFile ([File Object], callback)

Get base64 data of an image file, which is useful to preview image before uplloading.

Events

beforeupload (e, file)

Triggered before uploading, return false to cancel uploading.

uploadprogress (e, file, loaded, total)

Triggered multiple times during uploading process.

uploadsuccess (e, file, result)

Triggered after uploading complete and response status is 200.

uploaderror (e, file, xhr, status)

Triggered after uploading complete and response status is not 200.

uploadcomplete (e, file, responseText)

Triggered after uploading complete.

uploadcancel (e, file)

Triggered when a uploading is canceled by cancel() method

Development

Clone repository from github:

git clone https://github.com/mycolorway/simple-uploader.git

Install npm dependencies:

npm install

Run default gulp task to build project, which will compile source files, run test and watch file changes for you:

gulp

Now, you are ready to go.

Publish

If you want to publish new version to npm and bower, please make sure all tests have passed before you publish new version, and you need do these preparations:

  • Check the version number in bower.json and package.json.

  • Add new release information in CHANGELOG.md. The format of markdown contents will matter, because build scripts will get version and release content from this file by regular expression. You can follow the format of the older release information.

  • Put your personal API tokens in /.token, which is required by the build scripts to request Github API for creating new release.

  • Commit changes and push.

Now you can run gulp publish task, which will request Github API to create new release.

If everything goes fine, you can see your release at https://github.com/mycolorway/simple-uploader/releases. At the End you can publish new version to npm with the command:

npm publish

Please be careful with the last step, because you cannot delete or republish a release on npm.

You might also like...

A CLI to upload files to IPFS and interact with them using wbeb3.storage

Storli A CLI to upload files to IPFS and interact with them using web3.storage Storli Usage Commands Usage $ npm install -g storli $ storli COMMAND ru

Aug 7, 2022

Quickly upload images to the cloud in Logseq.

Quickly upload images to the cloud in Logseq.

logseq-plugin-image-uploader Usage How to use it? Currently, we only support PicGo, so please open PicGo manually. By default, when you paste any cont

Nov 25, 2022

A website of pkupiano, allowing members upload their own recordings

A website of pkupiano, allowing members upload their own recordings

SoundLib: A Music Recording Library SoundLib (abbreviation of sound library), provides a site for users to upload their own music recordings. Todo Lis

Jun 16, 2022

An Obsidian plugin to upload your notes' metadata to your database.

An Obsidian plugin to upload your notes' metadata to your database.

Obsidian + PostgreSQL = ❤️ An Obsidian plugin to upload your notes' metadata to your database. Features send the Dataview annotations of a page to a P

Dec 19, 2022

Gyazo API wrapper made in TypeScript. *For now, only upload feature.

wrap-gyazo Gyazo API wrapper made in TypeScript. *For now, only upload feature. Installation npm i wrap-gyazo Register an application with Gyazo. Gyaz

Jan 11, 2022

Firebase Storage with Angular 14 example: Upload File, Retrieve, Display, Download Url & Delete using @angular/fire AngularFireStorage

Firebase Storage with Angular 14 example: Upload File, Retrieve, Display, Download Url & Delete using @angular/fire AngularFireStorage

Angular 14 File Upload to Firebase Storage example I will show you how to make Angular 14 Firebase Storage: File Upload/Display/Delete Application usi

Sep 7, 2022

upload your GitHub repo to IPFS -- creating censorship resistant code 🤘

upload your GitHub repo to IPFS -- creating censorship resistant code 🤘

githubtoipfs.com ⛓ What is this? githubtoipfs is a site to backup any public GitHub repo to IPFS, creating censorship resistant code 🤘 Why did I buil

Aug 22, 2022

This is food detection WebApp, which will tell users about the nutrients value of particular food image which they upload

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Sep 8, 2022

Spring Boot + Angular: File Upload & Download Example

Spring Boot + Angular: File Upload & Download Example

Spring Boot + Angular: File Upload & Download Example User Interface Local setup Step 1: Download or clone the source code from GitHub to a local mach

Sep 3, 2022
Releases(v3.0.0)
Owner
彩程设计
彩程设计
🖼 Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well with or without a framework.

file-upload-with-preview ?? Simple file-upload utility that shows a preview of the uploaded image. Written in TypeScript. No dependencies. Works well

John Datserakis 427 Dec 26, 2022
Calculating Pi number without limitation until 10k digits or more in your browser powered by JS without any third party library!

PI Calculator Web JS (Online) Calculating Pi number without limitation until 10k digits or more in your browser powered by JS without any third party

Max Base 6 Jul 27, 2022
A simple Node.js code to get unlimited instagram public pictures by every user without api, without credentials.

Instagram Without APIs Instagram Scraping in August 2022, no credentials required This is a Node.js library, are you looking for the same in PHP? go t

Francesco Orsi 28 Dec 29, 2022
A short project to automatically upload multiple pictures to pinata.cloud

Papel Mache Papel Mache is an app that uploads pictures to IPFS through pinata.cloud Requirements pinata/sdk: 1.1.14 node: 14.17.6 Node Node installat

Cardano Valley 7 Aug 18, 2022
This is a simple script to upload Multiple files into google drive using google drive API and Nodejs.

Welcome to gDrive Multiple File Upload ?? This is a simple script to upload Multiple files into google drive using google drive API and Nodejs Install

Jayamal Sanuka Hettiarachchi 1 Dec 29, 2021
Dead simple program to upload NFT data to IPFS via nft.storage

NFTP The simplest way to publish files and folders to IPFS, with one command. 100% FREE to upload as much files as you want, powered by nft.storage. N

factoria 35 Dec 11, 2022
A free e-library for developer to read and upload ebooks they would like to share with the community and help other developers grow.

Techlib ?? Techlib A free e-library for developer to read and upload ebooks they would like to share with the community and help other developers grow

Paschal 20 Dec 15, 2022
Programmatically upload NFT assets to OpenSea.io for free

OpenSea Uploader This is the example repository for my blog post How to Mint 100,000 NFTs For Free. Please note that this is merely a proof of concept

Andre Rabold 18 Sep 15, 2022
View maps, graphs, and tables of your save and compete in a casual, evergreen leaderboard of EU4 achievement speed runs. Upload and share your save with the world.

PDX Tools PDX Tools is a modern EU4 save file analyzer that allow users to view maps, graphs, and data tables of their save all within the browser. If

PDX Tools 24 Dec 27, 2022
A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the link 🔗 or via mail ✉️ which remains active for 24hours 🕙.

eShare | File Sharing App A file sharing service, where you can upload files and provide a download link for anyone on the internet by sharing the lin

Akhil Bhalerao 7 Nov 20, 2022