🚨 Active Supply Chain Attack:node-ipc Package Compromised.Learn More
Socket
Book a DemoSign in
Socket

sync-upload

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-upload

asynchronous upload file

latest
Source
npmnpm
Version
0.0.4
Version published
Maintainers
1
Created
Source

sync-upload

a upload plugin for browser

Usage

<form enctype="multipart/form-data">
	<label for="myFile">选择文件</label>
	<input type="file" id="myFile" />
</form>

<script>
var Uploader = require('sync-upload')
var uploader = new Uploader({useUi: true})
document.getElementById('myFile').addEventListener('change',e=>{
	uploader.init({
		url: '//video.qq.com/upload',
		data: {
			file: e.target
		}
	})
})
</script>

Uploader(options)

  • url cgi for uploader
  • data post data to cgi
  • useIframe use iframe method to upload
  • enctype request Content-Type
  • callbackId iframe frameElement[callbackId]
  • timeout timeout for request
  • useUi use loading UI
  • extendClass loading animation className
  • progress upload progress not support iframe
  • success success to upload event
  • error fail to upload event

External API

  • getPreviewImageURL get local file preview Url

Keywords

sync-upload

FAQs

Package last updated on 13 Feb 2018

Did you know?

Socket

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.

Install

Related posts