swfobject直接上传到amazon s3如何向s3发送不同的文件名

时间:2013-02-06 23:03:46

标签: amazon-s3 swfobject

我的上传系统运行正常。我使用Swfobject直接上传到amazon s3。它我的系统将文件保存在适当的用户文件夹中。如果用户A上传它将上传A /当用户B上传时它将上传到B /文件夹。总而言之,一切都很好,除了。我需要根据他们填写的html表单更改文件名。可以这样做吗?可能通过Javascript或JQuery?

这是我的代码

<script type="text/javascript">

    var isMacUser = false;
    var successURL = 'http://dummy.com/dummy/filelist.php';

        var swfu;

        window.onload = function() {
            var settings = {
                flash_url : "swfupload/swfupload.swf",
                flash9_url : "swfupload/swfupload_fp9.swf",
                //upload_url: "upload.php",
        upload_url: "http://dummy.s3.amazonaws.com/",
        post_params: {"AWSAccessKeyId":"THIS IS ACCESSKEY", "key":"UsernamePHPEcho/${filename}", "acl":"public-read", "policy":"GIBBERISH GOES HERE", "signature":"a/thBERU0dLtd6r+QvRbUJEvMxU=","success_action_status":"201", "content-type":"image/"},

        http_success : [201],
        assume_success_timeout : 0,


        // File Upload Settings
        file_post_name: 'file',
        file_size_limit : "100 MB",    // 100 MB
        file_types : "*.*",
        file_types_description : "All Files",
        file_upload_limit : "10",
        file_queue_limit : 3,

                custom_settings : {
                    progressTarget : "fsUploadProgress",
                    cancelButtonId : "btnCancel"
                },
                debug: false,

                // Button Settings
        button_placeholder_id : "spanButtonPlaceholder",
        button_width: 61,
        button_height: 22,
        button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
        button_cursor: SWFUpload.CURSOR.HAND,



        moving_average_history_size: 10,

                // The event handler functions are defined in handlers.js
                swfupload_preload_handler : preLoad,
                swfupload_load_failed_handler : loadFailed,
                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
            };

            swfu = new SWFUpload(settings);
         };
    </script>

0 个答案:

没有答案