使用jquery.uploadify动态传递自己的参数
上传碰到这个问题在上传文件的时候同时上传文件的类型。。上网找了半天。总于解决了。。分享一下了。。直接例子了。。
html
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<title>Uploadify</title>
<link href="plugins/jqueryupload/css/default.css" rel="stylesheet" type="text/css" />
<link href="plugins/jqueryupload/css/uploadify.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="plugins/jqueryupload/js/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="plugins/jqueryupload/js/swfobject.js"></script>
<script type="text/javascript" src="plugins/jqueryupload/js/jquery.uploadify.v2.1.0.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#uploadify").uploadify({
'uploader' : 'uploadify.swf',
'script' : '/caobise/three.do?method=upload',
'scriptData' : {'ttype':$('#ttype').val()},
'cancelImg' : 'plugins/jqueryupload/images/cancel.png',
'folder' : 'upload',
'queueID' : 'fileQueue',
'auto' : false,
'multi' : true,
'simUploadLimit' : 2,
'buttonText' : 'BROWSE'
});
});
</script>
</head>
<body>
<div id="fileQueue"></div>
<select id="ttype" name="ttype" ><option
value="1">外文翻译</option><option
value="2">文献综述</option><option
value="3">开题报告</option> </select>
<input type="file" name="uploadify" id="uploadify" />
<p>
<a href="javascript:$('#uploadify').uploadifySettings('scriptData',{'ttype':$('#ttype').val()});
jQuery('#uploadify').uploadifyUpload()">开始上传</a>
<a href="javascript:jQuery('#uploadify').uploadifyClearQueue()">取消所有上传</a>
</p>
</body>
</html>
红色部分主要问题所在了。。
在后台使用 request.getParameter("ttype") 即可!
使用jquery.uploadify动态传递自己的参数的更多相关文章
- jquery.uploadify 动态传递参数
最近 项目中使用到 uplaodify 来实现上传文件的功能.在传输动态参数的时候,遇到了问题! 使用官网提供的 settings 方法 官方例子function changeBtnText() { ...
- jquery 如何动态绑定传递到后台上传组件参数
$("#upload_photo").uploadify({ 'auto' : false, 'method' : "post", 'height' : 20, ...
- 通过List<String>动态传递参数给 sqlcommand.Parameters
通过List<String>动态传递参数 private void GetallChecked_TreeNote(TreeNodeCollection aNodes, ref int To ...
- 动态传递参数到DevExpress.XtraReports的小结
原文:动态传递参数到DevExpress.XtraReports的小结 前两种方法和WinForm一样,可以传递参数.数组.实体对象.DataTable等1. 采用构造函数具体用法:在Report中p ...
- jqery autocomplete 动态传递参数的问题
今天弄一个autocomplete 向后后台动态传递参数的问题 老的写法: params: { "saleid": $("#divSalesman input[field ...
- 小程序动态添加class及调接口传递多个参数
1.动态添加class <view class="step2 {{indication == 2 ?'on':''}}"> <view class='tc lef ...
- Jquery Uploadify使用参数详解
开始上传 $('#uploadify_1').uploadifyUpload(); 1 uploader uploadify.swf文件的相对路径,该swf文件是一个带有文字BROWSE的按钮,点击 ...
- [K/3Cloud] 动态表单打开时传递一个自定义参数并在插件中获取
插件中在调用动态表单时,通过DynamicFormShowParameter的CustomParams,增加自定义的参数. /// <summary> /// 库存查询 /// </ ...
- 在动态THML语句中调用JS函数传递带空格参数的问题
刚刚遇到一个问题,调用js函数的参数里带空格,造成调用失败的问题. 部分代码如下: html+="<div><a href=javascript:confirm(&qu ...
随机推荐
- [phpcms v9]自定义表单添加验证码验证功能
修改 \phpcms\templates\default\formguide\show.html 中添加验证码显示 <input type="text" id=" ...
- CEdit 控制键盘操作
写在前面的话:在工作中要实现这样一个功能,在一个树形控件中选择要发送消息的客户,添加到一个列表控件中,点击确定跳到一个信息发送页面如下图,在发送人编辑框中显示选择的客户,要实现的就是即允许用户删除用户 ...
- C++访问mysql数据库
C++连接mysql数据库,并取数据进行显示本例中,在mysql中已经存在了一个数据库test,并在test数据库中创建了一张表stu做测试,表中包含3个字段 需要把mysql目录下的libmysql ...
- LeetCode: Integer to Roman 解题报告
Integer to Roman Given an integer, convert it to a roman numeral. Input is guaranteed to be within t ...
- LeetCode: Divide Two Integers 解题报告
Divide Two Integers Divide two integers without using multiplication, division and mod operator. SOL ...
- 解决Django中在.js文件中用ajax请求后端,找不到CSRF问题
function getCookie(name) { var cookieValue = null; if (document.cookie && document.cookie != ...
- Android集成银联支付,提示java.lang.UnsatisfieldLinkError错误
尽管解决方法很简单,但还是记录一下吧. 最近做银联支付(Android),官方给的demo是eclipse的.按照官方(https://open.unionpay.com/ajweb/product) ...
- 【C#/WPF】Image图片的Transform变换:平移、缩放、旋转
WPF中图像控件Image的变换属性Transform: 平移 缩放 旋转 即要想实现图片的平移.缩放.旋转,是修改它所在的Image控件的Transform变换属性. 下面在XAML中定义了Imag ...
- u-boot 2016.05 添加u-boot cmd
记录一下如何在u-boot 添加一个自己想要的命令. 首先来看一下宏,include/command.h 218 #define U_BOOT_CMD(_name, _maxargs, _rep, _ ...
- uboot全局数据gd_t、bd_t和device_t
gd_t定义在include/asm-arm/global_data.h 33 /* Keep it *SMALL* and remember to set CFG_GBL_DATA_SIZE &g ...