GithubHelp home page GithubHelp logo

ajaxupload's Introduction

仿百度云AJax上传文件插件

运行项目:(本地要有node环境)

1、将ajaxUpload clone到本地

2、npm install 安装相关模块

3、grunt default 构建文件

3、node app.js启动项目

4、浏览器中访问localhost:3000/ajax 便能上传文件

在自己项目中使用此插件:

1、将项目中public下的zjmy.upload文件夹复制到自己项目中

2、在自己页面中引入dest目录下的js、css文件(先要引用jquery)

默认配置项:
 url: "/"  上传地址
 method: 'POST'  请求方法
 maxFileCount:'10'  一次最大的上传数量
 allowSuffix: 'image/png,image/jpeg,audio/mp3,audio/mpeg,text/plain,application/msword', 允许的后缀列表
 success: 回调
 error: 
 complete:所有文件都上传后的回调

使用:

<link href="**my.uploadmy.upload.css" rel="stylesheet">
<script src="**my.upload/jquery-1.8.0.min.js"></script>
<script src="**my.uploadmy.upload.js"></script>

<div id="up" class="gradientHead upDiv">上传文件</div>
$('#up').upload({
                method: 'POST',
                url: '/upload',
                maxFileCount:2
                。
                。
                。
            });

注意: 使用时可以根据实际情况修改: zjmy.upload.js中: $(this).after("");修改name名称,与后台参数对应 或:响应回调中:xhr.status == 201、200等,根据后台指定的状态码确定;

ajaxupload's People

Contributors

xiyuyizhi avatar

Stargazers

 avatar  avatar

Watchers

 avatar

ajaxupload's Issues

缺少jquery文件

项目构建完成后 运行 发现 ajaxUpload-master\public\zjmy.upload 这个目录下 缺少jquery-1.8.0.min.js 这个文件。我把文件加进去就没问题了

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.