jsp swfupload 2.2 批量上傳圖片並將圖片名儲存到資料庫(1/6)

來源:互聯網
上載者:User

<%@ page contentType="text/html;charset=UTF-8"%>
<%
    double perMaxSize = 1.5;//單個檔案允許的max大小
    String sizeUnit = "MB";//perMaxSize資料對應的單位
    String ext = "*.jpg;*.jpeg;*.gif";//允許上傳的檔案類型
    //檔案上傳提交的目標頁面
    StringBuffer uploadUrl = new StringBuffer("http://");
    uploadUrl.append(request.getHeader("Host"));
    uploadUrl.append(request.getContextPath());
    uploadUrl.append("/admin/swfuploadexample/UploadFileExampleSubmit.jsp教程");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>批量相片上傳</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="css教程/default.css" rel="stylesheet" type="text/css" />
<script type="text/javascript教程" src="js/swfupload.js"></script>
<script type="text/javascript" src="js/swfupload.swfobject.js"></script>
<script type="text/javascript" src="js/swfupload.queue.js"></script>
<script type="text/javascript" src="js/fileprogress.js"></script>
<script type="text/javascript" src="js/handlers.js"></script>

<script type="text/javascript">
var swfu;

SWFUpload.onload = function () {
    var settings = {
        flash_url : "js/swfupload.swf",
        upload_url: "<%=uploadUrl.toString()%>",
        post_params: {
            "user_id" : "stephen830",
            "pass_id" : "123456"
        },
        file_size_limit : "<%=perMaxSize%> <%=sizeUnit%>",
        file_types : "<%=ext%>",
        file_types_description : "<%=ext%>",
        file_upload_limit : 100,
        file_queue_limit : 0,
        custom_settings : {
            progressTarget : "fsUploadProgress",
            cancelButtonId : "btnCancel",
            uploadButtonId : "btnUpload",
            myFileListTarget : "idFileList"
        },
        debug: false,
        auto_upload:false,

        // Button Settings
        button_image_url : "images/XPButtonUploadText_61x22.png",    // Relative to the SWF file
        button_placeholder_id : "spanButtonPlaceholder",
        button_width: 61,
        button_height: 22,

        // The event handler functions are defined in handlers.js
        swfupload_loaded_handler : swfUploadLoaded,
        file_queued_handler : fileQueued,
        file_queue_error_handler : fileQueueError,
        file_dialog_complete_handler : fileDialogComplete,
        upload_start_handler : uploadStart,
        upload_progress_handler : uploadProgress,
        upload_error_handler : uploadError,
        upload_success_handler : uploadSuccess,
        upload_complete_handler : uploadComplete,
        queue_complete_handler : queueComplete,    // Queue plugin event
       
        // SWFObject settings
        minimum_flash_version : "9.0.28",
        swfupload_pre_load_handler : swfUploadPreLoad,
        swfupload_load_failed_handler : swfUploadLoadFailed
    };

    swfu = new SWFUpload(settings);
}

首頁 1 2 3 4 5 6 末頁
相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.