npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

express-large-uploader

v1.0.2

Published

express large file upload

Downloads

9

Readme

#大文件上传控件使用帮助

基于express的大文件上传组件,使用HTML5 的File API对文件分片上传到服务端,支持断点续传。

一、运行DEMO

git clone https://gitee.com/dreamidea/express-large-uploader.git
cd express-large-uploader
npm install
npm run test

在浏览器打开http://localhost:8888/upload/client/file-upload-demo.html 查看DEMO。

二、与express集成

1、服务端

安装模块

npm install express-large-uploader --save

在express中引入模块

const FileUpload = require('express-large-uploader');
app.use(FileUpload({
        'prefix' : '/upload/',
        'uploadDir' : '/data/put_upload_files_here',
        'uploadTempDir' : '/data/put_upload_files_here/tmp'
 }))

其中prefix是url前缀,主要是前端js引用时用到, uploadDir是上传的文件存放位置, uploadTempDir是分片文件存放的位置,如果不指定默认在uploadDir下的tmp文件夹

2、前端

在页面尾部中引入js

<script type="text/javascript" src="/upload/file-upload.js"></script>

路径中的upload对应的就是服务端设置的prefix

页面中使用控件:

<input type="text" name="file" id="file"/>
<input type="button" name="tg" id="tg" value="上传大文件" upload-ref="#file" upload-conf-keepname="false" />

有upload-ref属性的元素点击事件会触发文件上传的动作,upload-ref的值就是上传结果(文件名)存放的元素(一般是文本表单,不要使用file类型)。upload-conf-keepname表示上传时是否保持文件名,如果为false上传时将md5 hash作为文件名。

打开前端示例:http://ip:port/upload/client/file-upload-demo.html, upload对应的就是服务端设置的prefix