Visualizzazione dei risultati da 1 a 2 su 2
  1. #1

    SwfUpload, qualcuno mi suggerisce qualche riga di codice in asp??

    Salve a tutti,

    credo di poter risolvere finalmente il mio problema di upload multiplo di 100 foto alla volta con SWFUPLOAD. Il problema è che i sorgenti hanno come linguaggio di riferimento server-side PHP od ASP.NET, mentre io mastico solamente ASP, javascript e vbscript. Questo è il sorgente originale della pagina di upload in PHP, nessuno può darmi qualche suggerimento per modificare questo ed adattarlo all'asp??? Io ho già uno script funzionante in asp per l'upload singolo di file tramite html, posso sfruttarlo oppure devo scrivere qualcosa di ex-novo??

    index.php
    -----------------------------------
    <?php
    session_start();

    if (count($_FILES)) {
    // Handle degraded form uploads here. Degraded form uploads are POSTed to index.php. SWFUpload uploads
    // are POSTed to upload.php
    }

    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
    <title>SWFUpload Demos - Multi-Instance Demo</title>
    <link href="../css/default.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../swfupload/swfupload.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 upload1, upload2;

    window.onload = function() {
    upload1 = new SWFUpload({
    // Backend Settings
    upload_url: "upload.php",
    post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},

    // File Upload Settings
    file_size_limit : "102400", // 100MB
    file_types : "*.*",
    file_types_description : "All Files",
    file_upload_limit : "10",
    file_queue_limit : "0",

    // Event Handler Settings (all my handlers are in the Handler.js file)
    file_dialog_start_handler : fileDialogStart,
    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,

    // Button Settings
    button_image_url : "XPButtonUploadText_61x22.png",
    button_placeholder_id : "spanButtonPlaceholder1",
    button_width: 61,
    button_height: 22,

    // Flash Settings
    flash_url : "../swfupload/swfupload.swf",


    custom_settings : {
    progressTarget : "fsUploadProgress1",
    cancelButtonId : "btnCancel1"
    },

    // Debug Settings
    debug: false
    });

    upload2 = new SWFUpload({
    // Backend Settings
    upload_url: "upload.php",
    post_params: {"PHPSESSID" : "<?php echo session_id(); ?>"},

    // File Upload Settings
    file_size_limit : "200", // 200 kb
    file_types : "*.jpg;*.gif;*.png",
    file_types_description : "Image Files",
    file_upload_limit : "10",
    file_queue_limit : "5",

    // Event Handler Settings (all my handlers are in the Handler.js file)
    file_dialog_start_handler : fileDialogStart,
    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,

    // Button Settings
    button_image_url : "XPButtonUploadText_61x22.png",
    button_placeholder_id : "spanButtonPlaceholder2",
    button_width: 61,
    button_height: 22,

    // Flash Settings
    flash_url : "../swfupload/swfupload.swf",

    swfupload_element_id : "flashUI2", // Setting from graceful degradation plugin
    degraded_element_id : "degradedUI2", // Setting from graceful degradation plugin

    custom_settings : {
    progressTarget : "fsUploadProgress2",
    cancelButtonId : "btnCancel2"
    },

    // Debug Settings
    debug: false
    });

    }
    </script>
    </head>
    <body>
    <div id="header">
    <h1 id="logo">SWFUpload</h1>
    <div id="version">v2.2.0</div>
    </div>
    <div id="content">
    <h2>Multi-Instance Demo</h2>
    <form id="form1" action="index.php" method="post" enctype="multipart/form-data">


    This page demonstrates how multiple instances of SWFUpload can be loaded on the same page.
    It also demonstrates the use of the graceful degradation plugin and the queue plugin.</p>
    <table>
    <tr valign="top">
    <td>
    <div>
    <div class="fieldset flash" id="fsUploadProgress1">
    <span class="legend">Large File Upload Site</span>
    </div>
    <div style="padding-left: 5px;">
    <span id="spanButtonPlaceholder1"></span>
    <input id="btnCancel1" type="button" value="Cancel Uploads" onclick="cancelQueue(upload1);" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />


    </div>
    </div>
    </td>
    <td>
    <div>
    <div class="fieldset flash" id="fsUploadProgress2">
    <span class="legend">Small File Upload Site</span>
    </div>
    <div style="padding-left: 5px;">
    <span id="spanButtonPlaceholder2"></span>
    <input id="btnCancel2" type="button" value="Cancel Uploads" onclick="cancelQueue(upload2);" disabled="disabled" style="margin-left: 2px; height: 22px; font-size: 8pt;" />


    </div>
    </div>
    </td>
    </tr>
    </table>
    </form>
    </div>
    </body>
    </html>
    ____________________________
    upload.php
    ---------------------------------
    <?php
    if (isset($_POST["PHPSESSID"])) {
    session_id($_POST["PHPSESSID"]);
    }
    session_start();

    // The Demos don't save files


    // In this demo we trigger the uploadError event in SWFUpload by returning a status code other than 200 (which is the default returned by PHP)
    if (!isset($_FILES["Filedata"]) || !is_uploaded_file($_FILES["Filedata"]["tmp_name"]) || $_FILES["Filedata"]["error"] != 0) {
    // Usually we'll only get an invalid upload if our PHP.INI upload sizes are smaller than the size of the file we allowed
    // to be uploaded.
    header("HTTP/1.1 500 File Upload Error");
    if (isset($_FILES["Filedata"])) {
    echo $_FILES["Filedata"]["error"];
    }
    exit(0);
    }

    ?>

  2. #2

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.