用Uploadify做上传时,点击uploadify.swf图标无法弹出文件选择窗口-问答-阿里云开发者社区-阿里云

开发者社区> 问答> 正文

用Uploadify做上传时,点击uploadify.swf图标无法弹出文件选择窗口

a123456678 2016-07-13 17:08:11 3184

screenshot

<%@ 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>文件上传</title>
    
 <link href="styles/uploadify.css" rel="stylesheet" type="text/css" />
  
 <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
 <script type="text/javascript" src="js/jquery.uploadify-3.1.min.js"></script> 
 
  </head>
<script type="text/javascript">
$(document).ready(function() {
 $("#uploadify").uploadify({
                'uploader'       : '<%=path %>/module/upload/uploadify.swf',
                'script'         : 'uplaodAction!doUpload.action',//后台处理的请求
                'cancelImg'      : '<%=path %>/images/uploadify-cancel.png',
                'folder'         : 'uploads',//您想将文件保存到的路径
                'queueID'        : 'fileQueue',//与下面的id对应
                'queueSizeLimit'  :1,
  'fileExt' : '*.rar;*.zip', //控制可上传文件的扩展名,启用本项时需同时声明fileDesc
                'fileDesc'    : 'rar文件或zip文件',
                'auto'           : false,
                'multi'          : true,
                'simUploadLimit' : 2,
                'sizeLimit'     : 100 * 1024 *1024,
                'buttonText'     : '上传'
 });
});
</script>
<body>
  <form action="uplaodAction!doUpload.action" method="post" enctype="multipart/form-data">
 <div id="fileQueue"></div>
        <input type="file" name="uploadify" id="uploadify" />
        <p>
        <a href="javascript:$('#uploadify').uploadifyUpload()">开始上传</a>&nbsp;
        <a href="javascript:$('#uploadify').uploadifyClearQueue()">取消上传</a>
        </p>
</form>
  </body>
</html>
JavaScript 前端开发
分享到
取消 提交回答
全部回答(1)
  • a123456678
    2019-07-17 19:55:51
    <a href="javascript:$('#uploadify').uploadifyUpload()" >开始上传</a>&nbsp;
    45            <a href="javascript:$('#uploadify').uploadifyClearQueue()">取消上传</a>
    46            </p>
    看下官网用法》
    
    <p><a href="javascript:$('#file_upload').uploadify('upload','*')">上传图片</a>  
        <a href="javascript:$('#file_upload').uploadify('cancel')">取消上传</a>
    0 0
开发与运维
使用钉钉扫一扫加入圈子
+ 订阅

集结各类场景实战经验,助你开发运维畅行无忧

推荐文章
相似问题
推荐课程