- 浏览: 2117705 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (1878)
- [网站分类]ASP.NET (141)
- [网站分类]C# (80)
- [随笔分类]NET知识库 (80)
- [随笔分类]摘抄文字[非技术] (3)
- [随笔分类]养生保健 (4)
- [网站分类]读书区 (16)
- [随笔分类]赚钱 (7)
- [网站分类].NET新手区 (233)
- [随笔分类]网站 (75)
- [网站分类]企业信息化其他 (4)
- [网站分类]首页候选区 (34)
- [网站分类]转载区 (12)
- [网站分类]SQL Server (16)
- [网站分类]程序人生 (7)
- [网站分类]WinForm (2)
- [随笔分类]错误集 (12)
- [网站分类]JavaScript (3)
- [随笔分类]小说九鼎记 (69)
- [随笔分类]技术文章 (15)
- [网站分类]求职面试 (3)
- [网站分类]其他技术区 (6)
- [网站分类]非技术区 (10)
- [发布至博客园首页] (5)
- [网站分类]jQuery (6)
- [网站分类].NET精华区 (6)
- [网站分类]Html/Css (10)
- [随笔分类]加速及SEO (10)
- [网站分类]Google开发 (4)
- [随笔分类]旅游备注 (2)
- [网站分类]架构设计 (3)
- [网站分类]Linux (23)
- [随笔分类]重要注册 (3)
- [随笔分类]Linux+PHP (10)
- [网站分类]PHP (11)
- [网站分类]VS2010 (2)
- [网站分类]CLR (1)
- [网站分类]C++ (1)
- [网站分类]ASP.NET MVC (2)
- [网站分类]项目与团队管理 (1)
- [随笔分类]个人总结 (1)
- [随笔分类]问题集 (3)
- [网站分类]代码与软件发布 (1)
- [网站分类]Android开发 (1)
- [网站分类]MySQL (1)
- [网站分类]开源研究 (6)
- ddd (0)
- 好久没写blog了 (0)
- sqlserver (2)
最新评论
-
JamesLiuX:
博主,能组个队么,我是Freelancer新手。
Freelancer.com(原GAF – GetAFreelancer)帐户里的钱如何取出? -
yw10260609:
我认为在混淆前,最好把相关代码备份一下比较好,不然项目完成后, ...
DotFuscator 小记 -
日月葬花魂:
大哥 能 加我个QQ 交流一下嘛 ?51264722 我Q ...
web应用程序和Web网站区别 -
iaimg:
我想问下嵌入delphi写的程序总是出现窗体后面感觉有个主窗体 ...
C#自定义控件:WinForm将其它应用程序窗体嵌入自己内部 -
iaimg:
代码地址下不了啊!
C#自定义控件:WinForm将其它应用程序窗体嵌入自己内部
<html>
<head>
<!-- Include the javascript -->
<script src="multifile_compressed.js"></script>
</head>
<body>
<!-- This is the form -->
<form enctype="multipart/form-data" action="your_script_here.script" method = "post">
<!-- The file element -- NOTE: it has an ID -->
<input id="my_file_element" type="file" name="file_1" >
<input type="submit">
</form>
Files:
<!-- This is where the output will appear -->
<div id="files_list"></div>
<script>
<!-- Create an instance of the multiSelector class, pass it the output target and the max number of files -->
var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 3 );
<!-- Pass in the file element -->
multi_selector.addElement( document.getElementById( 'my_file_element' ) );
</script>
</body>
</html>
/**
* Convert a single file-input element into a 'multiple' input list
*
* Usage:
*
* 1. Create a file input element (no name)
* eg. <input type="file" id="first_file_element">
*
* 2. Create a DIV for the output to be written to
* eg. <div id="files_list"></div>
*
* 3. Instantiate a MultiSelector object, passing in the DIV and an (optional) maximum number of files
* eg. var multi_selector = new MultiSelector( document.getElementById( 'files_list' ), 3 );
*
* 4. Add the first element
* eg. multi_selector.addElement( document.getElementById( 'first_file_element' ) );
*
* 5. That's it.
*
* You might (will) want to play around with the addListRow() method to make the output prettier.
*
* You might also want to change the line
* element.name = 'file_' + this.count;
* ...to a naming convention that makes more sense to you.
*
* Licence:
* Use this however/wherever you like, just don't blame me if it breaks anything.
*
* Credit:
* If you're nice, you'll leave this bit:
*
* Class by Stickman -- http://www.the-stickman.com
* with thanks to:
* [for Safari fixes]
* Luis Torrefranca -- http://www.law.pitt.edu
* and
* Shawn Parker & John Pennypacker -- http://www.fuzzycoconut.com
* [for duplicate name bug]
* 'neal'
*/
function MultiSelector( list_target, max ){
// Where to write the list
this.list_target = list_target;
// How many elements?
this.count = 0;
// How many elements?
this.id = 0;
// Is there a maximum?
if( max ){
this.max = max;
} else {
this.max = -1;
};
/**
* Add a new file input element
*/
this.addElement = function( element ){
// Make sure it's a file input element
if( element.tagName == 'INPUT' && element.type == 'file' ){
// Element name -- what number am I?
element.name = 'file_' + this.id++;
// Add reference to this object
element.multi_selector = this;
// What to do when a file is selected
element.onchange = function(){
// New file input
var new_element = document.createElement( 'input' );
new_element.type = 'file';
// Add new element
this.parentNode.insertBefore( new_element, this );
// Apply 'update' to element
this.multi_selector.addElement( new_element );
// Update list
this.multi_selector.addListRow( this );
// Hide this: we can't use display:none because Safari doesn't like it
this.style.position = 'absolute';
this.style.left = '-1000px';
};
// If we've reached maximum number, disable input element
if( this.max != -1 && this.count >= this.max ){
element.disabled = true;
};
// File element counter
this.count++;
// Most recent element
this.current_element = element;
} else {
// This can only be applied to file input elements!
alert( 'Error: not a file input element' );
};
};
/**
* Add a new row to the list of files
*/
this.addListRow = function( element ){
// Row div
var new_row = document.createElement( 'div' );
// Delete button
var new_row_button = document.createElement( 'input' );
new_row_button.type = 'button';
new_row_button.value = 'Delete';
// References
new_row.element = element;
// Delete function
new_row_button.onclick= function(){
// Remove element from form
this.parentNode.element.parentNode.removeChild( this.parentNode.element );
// Remove this row from the list
this.parentNode.parentNode.removeChild( this.parentNode );
// Decrement counter
this.parentNode.element.multi_selector.count--;
// Re-enable input element (if it's disabled)
this.parentNode.element.multi_selector.current_element.disabled = false;
// Appease Safari
// without it Safari wants to reload the browser window
// which nixes your already queued uploads
return false;
};
// Set row value
new_row.innerHTML = element.value;
// Add button
new_row.appendChild( new_row_button );
// Add it to the list
this.list_target.appendChild( new_row );
};
};
发表评论
-
where T:new() 是什么意思
2014-04-18 09:26 1408where T:new() 是什么意思 经常看到方法后面 ... -
好久没写blog了
2012-05-21 18:43 2好久没写blog了 -
test
2011-03-19 09:48 790testddddddddddd -
QQ自动发日志分析
2011-03-10 18:15 1235首先列举比较重要的问 ... -
test
2011-02-23 18:03 783test -
test
2011-02-23 17:53 853test -
为啥cnblogs的数据不能导了
2011-02-23 11:03 884为啥cnblogs的数据不能导了内容 -
如何保护.net中的dll文件(防破解、反编译)
2010-07-30 00:28 1459.net是一种建立在虚拟机上执行的语言,它直接生成 MSIL ... -
提搞网站访问速度可做哪些优化
2010-08-08 15:30 1091一、 服务器优化 ... -
ASP.NET(c#)如何判断浏览器是否支持cookies
2010-07-29 09:33 1688实例代码: 下面是写cookie ... -
N点虚拟主机管理系统(For Windows2003/2008)功能及介绍
2010-04-09 11:23 2210N点虚拟主机管理系统是 ... -
使用c#+(datagrid控件)编辑xml文件
2010-04-06 09:13 1129对xml文件的记录进行删除,修改,或增加新记录。 利用了d ... -
HTTP代理模块(HTTP Proxy)
2010-04-04 10:19 3015HTTP代理模块(HTTP Proxy ... -
Error 80040154 retreiving COM Class factory
2010-03-29 09:23 22251.ask: Greetings, I have ... -
petshop4.0 详解之二(数据访问层之数据库访问设计)
2010-03-27 11:08 1048在系列一中,我从整体上分析了PetShop的架构设计,并提及了 ... -
分享十五个最佳jQuery幻灯插件和教程
2010-03-25 09:17 1989<p>在网站前端中使用jQuery库已经变得越来越 ... -
20个软件开发常用设计文档大全下载
2009-08-27 10:22 936搜集了一些软件开发的常用文档,分享给大家 总下载地址: h ... -
asp.net 在线 mp3,wma, avi
2009-09-04 13:58 9141.前台js<script type="tex ... -
sql db link string
2009-09-06 21:52 945SQL Server ODBC Standar ... -
ASP.Net2.0小技巧 保持滚动条的位置 焦点移动到某个控件 $符号轻松的使用FindControl
2009-09-11 11:05 1269您可能不知道的ASP.Net2.0 ...
相关推荐
Multiple File Upload - jQuery文件上传插件
利用jQuery Multiple File Upload Plugin插件,实现的多文件上传,
jquery多文件上传jquery多文件上传jquery多文件上传
element-ui中el-upload多文件一次性上传的实现 项目需求是多个文件上传,在一次请求中完成,而ElementUI的上传组件是每个文件发一次上传请求,因此我们借助FormData的格式向后台传文件组 html代码 <div class="...
多文件上传 一个示例多文件上传实现。 要了解它是如何实现的,请查看示例文件夹。 一般信息 初始化 当运行multiple-file-upload.js ,它会将其自身附加到window对象作为window.MultipleFileUpload 。 要创建新的多...
multiple属性不支持IE9以下版本浏览器,只能利用后面符合的加减来实现多文件上传了,要不然只能用控件来实现了。Demo拿去按照自己的项目逻辑来使用。
JQUERY multiple-file-upload 多文件上传,ASP上传程序,Ajax方式上传,示例中带有多种方式的上传实例,本示例只针对ASP,自带有一个asp环境的上传类。所以原来是ASP系统的,可以直接使用哦。 运行环境:ASP
•Multiple File Upload Widgets on the same page •Multiple File Input Fields in one Form. •How to implement Chunked file uploads. •Cross domain uploads (Cross-site uploads). •How to add Drop zone ...
NULL 博文链接:https://qiaolevip.iteye.com/blog/1848378
- Upload multiple files at the same time (asynchonous)(一次上传多文件,异步刷新) - Cancel a single upload, or clear the full list(可以取消单个上传或清空上传列表) - Shows the overall progress(显示...
如果需要上传多文件可以把index.htm中的input加上multiple属性,对应的多文件前端显示及处理需要您对upload.asp进行修改调整,然后前端ajax获取数据进行处理。 关于“无组件上传类 Version 0.96”本次修改摘要: ...
Huge ASP upload is easy to use, hi-performance ASP file upload component with progress bar indicator. This component lets you upload multiple files with size up to 4GB to a disk or a database along ...
动态多文件上传(Dynamic Multiple File Upload)标签库v1.5 功能:实现文件的批量上传,可以对文件格式及数量的限制,可以删除不想上传的文件,在操作过程中不会上传所选文件,JS完全封装,只需要引入相应的JS文件并...
before-upload 上传文件之前的钩子,参数为上传的文件,若返回 false 或者返回 Promise 且被 reject,则停止上传 function(file) - - before-remove 删除文件之前的钩子,参数为上传的文件和文件列表,若返回 false...
vue el-upload上传文件的示例代码 话不多说 直接上代码 <el-upload :action="actionUrl" class="avatar-uploader" :multiple="false" name="files" ref="upload" :file-list="fileList" :on-preview=...
带有进度栏和Axios的React Hooks多文件上传示例 我们将使用Hooks创建一个React Multiple Files上传应用程序,该用户可以: 使用进度条查看每个文件的上传过程(百分比) 查看所有上传的文件 单击文件名时,下载...
能实现的功能主要包括:自由提取表单数据、自由限制上传扩展名、自由限制上传大小、自由选择文件保存类型(原文件名和时间随机命名), 即可以单个文件上传又可以多个文件批量上传,同时可以提取文件的二进制数据,以...
如果需要上传单文件可以把index.htm中的multiple="multiple"删除掉,对应的多文件前端显示及处理需要您对upload.asp进行修改调整,然后前端ajax获取数据进行处理。 关于“无组件上传类 Version 0.96”修改摘要: '...