今天在网上找了一天,想要找到一个比较全的使用案例,结果发现基本上全是一个版本的。。。

我的问题主要是上传完成后,还需要将路径获取到,然后保存到数据库。

查了一下资料发现有这么一个参数onComplete,然后就想明白了。

话不多,开始code

    <link rel="Stylesheet" href="js/uploadify.css" />

    <script type="text/javascript" src="js/jquery.min.js"></script>

    <script type="text/javascript" src="js/swfobject.js"></script>

    <script type="text/javascript" src="js/jquery.uploadify.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("#uploadify").uploadify({
'uploader': 'js/uploadify.swf',
'script': 'UploadFile.ashx',
'cancelImg': 'js/cancel.png',
'folder': 'upload',
'queueID': 'fileQueue',
'auto': true,
'multi': true,
'buttonText': '',
'buttonImg':'js/browseBtn.png',
'height':'',
'wmode':'transparent',
'onComplete':function (event, queueId, fileObj, response, data)
{
//可以用隐藏域隐藏起来
$('<li></li>').appendTo('.files').text(response);
},
}); });
</script>     //页面正文内容
    <input type="file" name="uploadify" id="uploadify" />
<%--<a href="javascript:$('#uploadify').uploadifyUpload()">上传</a>| <a href="javascript:$('#uploadify').uploadifyClearQueue()"> 取消上传</a>--%>
    <div id="fileQueue"></div>
<div class="files"></div>

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAABICAYAAABhlHJbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAIZdJREFUeNrsfAmYFdW17l/DmXruhqbpZmrmSVAEJKIXBRMhuY6Jzzib+PSqMZpo1Od0b3LVOJFcE8mNMSpGDYlG48TzaZwjBBUUEBBspgahoaHnPvOpU1V3rbWrTp+eGLy+vO99cbfbOqdqV9Xe//7XsNfaB+24446DVy6neh3V4VRD+LL0VdJUP6P6H1Qf4hOmd+FxqhdpmgauXAzDQDAY/BIyKplMBo7j8Mew67rj6PgbOs6mejEDeKkPnq7rqKqqwvjx41FZWYnCwsIv0aMSj8fR1NSEuro67Nu3T84RXhcRqMs0EuGt9GU0gzd69Ggcc8wxwjzbtkEIS/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COtd4IW8GtRkrawAVGA6ZheIajNSHoB+jlnzdi7ofWTstEOMSPcEzPvlUY55PmC26x09IC0POMfbrpbt2ramNg4xgI5YWZ2O8MRYQPVUnN7p5Nyb7PDgk2bn/yhaUvlBssbPCwtdY30kWvW+j46u95Eg76P9gQDqc9dQH+ecvs/JYA+hXZ/l8/+jHU8kzildopW9OPsSYsqnJX+InqHtTH2bZmkwePO6kzftrnvYuYr/ZucOrxzqz8gOpe/9/Xpf7ciwSGwbs8OCTyfOLX2B05r/JcAA6GDp3diucg0AAAAASUVORK5CYII=" alt="" />从网上找的图片,挺好看的,大家可以试试。

后台UploadFile.ashx文件中

HttpPostedFile file = context.Request.Files["FileData"];
string uploadpath = context.Server.MapPath(context.Request["folder"] + "\\"); if (file != null)
{
if (!Directory.Exists(uploadpath))
{
Directory.CreateDirectory(uploadpath);
}
file.SaveAs(uploadpath + file.FileName);
          //在这里将文件保存的路径返回到页面
context.Response.Write(uploadpath + file.FileName);
}
else
{
context.Response.Write("");
}

在处理程序中也可以返回自定义的json,前台onComplete事件中通过参数response接收到数据,解析,然后使用jquery将路径保存到隐藏域里面,在提交保存时,通过隐藏域对象获取到路径就ok了

我也是初次使用,大家要有好的建议可以一起讨论。

附上自己写的小demo:点击这里下载...

使用jquery.uploadify上传文件的更多相关文章

  1. jquery.uploadify上传文件配置详解(asp.net mvc)

    页面源码: <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" c ...

  2. SpringMVC+jquery.uploadify 上传文件

    前言 以前用Asp.net MVC+uploadify上传文件,最近学习SpringMVC,所以就用SpringMVC+uploadify做个上传文件的demo. 刚开始用form表单的方式提交,在C ...

  3. MVC3+jquery Uploadify 上传文件

    最近做项目用到了上传图片的功能,以前也写过这类代码,不过都是用传统的file标签,今天整理一个好用的插件Uploadify..都做了一些注释,一看便知. 可以去官网下载最新的:Uploadify下载地 ...

  4. [Plugin] JQuery.uploadify上传文件插件的使用详解For ASP.NET

    URL:http://www.cnblogs.com/xiaopin/archive/2010/01/21/1653523.html 今天下午整理文件上传的例子,感觉收集到的例子都很不人性话,后来找到 ...

  5. jquery uploadify上传文件插件导致浏览器崩溃问题解决方法

    自谷歌浏览器更新到(版本39.0.2171.99 )后,访问上传文件界面浏览器就崩溃了,而其他的浏览器不会出现问题. 出现这种问题的原因就是谷歌浏览器缓存问题,但将访问该jsp页面路径添加上时间戳后无 ...

  6. jQuery uploadify上传文件404,500错误

    1.如果部署到了IIS7的话,IIS7默认的大小为3000000.修改方法如下: 找到网站双击“请求筛选”——右边找到“编辑功能设置”——将“允许的最大内容长度”改成你想要的就行了. 2.当上传大文件 ...

  7. 使用 jquery 的 上传文件插件 uploadify 3.1 配合 java 来做一个简单的文件上次功能。并且在界面上有radio 的选择内容也要上传

    使用 jquery 的 上传文件插件 uploadify 3.1 配合 java 来做一个简单的文件上次功能.并且在界面上有radio 的选择内容也要上传 uploadify 插件的 下载和文档地址  ...

  8. Uploadify 上传文件插件详解

    Uploadify 上传文件插件详解 Uploadify是JQuery的一个上传插件,实现的效果非常不错,带进度显示.不过官方提供的实例时php版本的,本文将详细介绍Uploadify在Aspnet中 ...

  9. uploadify上传文件(2)--基础语法

    隔了好久,因为最近搬家,离开从小生活的城市,来到杭州.找工作.找房子等诸多事宜耽误了这篇文章许久.今天难得闲暇在旅馆中完成uploadify上传文件系列的第二篇--uploadify使用的基础语法. ...

随机推荐

  1. PE病毒初探——向exe注入代码

    PE文件其实就是Windows可执行文件,关于它的一些简要介绍摘自百度: PE文件被称为可移植的执行体是Portable Execute的全称,常见的EXE.DLL.OCX.SYS.COM都是PE文件 ...

  2. Jacky扯淡系列 – 验证码

    1 验证码的用途 防止恶意用户的csrf,比如一些bot的重复请求,类似的有密码破解等操作. 但是验证码这个东西会降低用户的体验度,因此不能将其作为必备的防护措施. 2 常见的验证码形式 通常的验证码 ...

  3. java-信息安全(十二)-数字签名【Java证书体系实现】

    概述 信息安全基本概念 数字证书 数字证书就是互联网通讯中标志通讯各方身份信息的一串数字,提供了一种在Internet上验证通信实体身份的方式,数字证书不是数字身份证,而是身份认证机构盖在数字身份证上 ...

  4. linux手动安装sbt过程

    ubuntu14 手动安装sbt 参见官网配置说明http://www.scala-sbt.org/release/tutorial/Manual-Installation.html 1.下载sbt通 ...

  5. 在Android Studio中查看Sqlite的方法

    只说最好的方法,使用工具stetho:http://facebook.github.io/stetho/ 1.在Gragle中加上如下语句: dependencies { // Stetho core ...

  6. java导出json格式文件

    生成json文件代码: import java.io.File; import java.io.FileWriter; import java.io.Writer; public class Crea ...

  7. SQLServer最耗资源时间的SQL语句

    作者kolachen http://blog.sina.com.cn/s/blog_63f3e0060102vcm0.html 先拷过来了,等有空再研究一下 执行最慢的SQL语句 SELECT (to ...

  8. 使用 JdbcTemplate 查询数据时报错:列名无效(已解决)

    又犯了一个错误. 争取没有下次了. 就算再犯,也要知道去哪找答案. 所以,记录一下,以示警戒. 报错 使用 JdbcTemplate 查询数据时,出现异常: PreparedStatementCall ...

  9. Python变量访问权限控制

    oop1.py文件代码 # user/bin/python class Foo: def bar(self): print('ok') def hello(self, name): print(&qu ...

  10. 笔记本串口连接IBM 小机

    首先要有一根两头母的九针串口线&USB转串口线其次,配置波特率19200.数据位8.停止位1.无校验位.流控:Xon/Xoff P4是9600,P5 P6都是19200了( 默认是19200波 ...