Plupload Onload显示上传文件的列表

时间:2014-09-16 07:27:49

标签: php jquery html5 jquery-plugins plupload

我正在使用Plupload File Plugin http://www.plupload.com/。我花了很多时间在谷歌和论坛上搜索它但却找不到。我也阅读了这个插件的文档,但没有运气。我的问题是我想在窗口加载时显示以前上传的所有图像。这是我的代码如果有可能或选项,请告诉我,谢谢:

<pre>
$("#uploader").plupload({
    // General settings
    runtimes: 'html5,flash,silverlight,html4',
    //url: {{ URL::asset('assets/js/plupload-2.1.2/examples/upload.php') }},
    //url: '../upload.php',
    url: "{{ URL::asset('assets/js/plupload-2.1.2/examples/upload.php') }}",
    // User can upload no more then 20 files in one go (sets multiple_queues to false)
    max_file_count: 200,
    chunk_size: '200mb',
    // Resize images on clientside if we can
    //            resize: {
    //                width: 200,
    //                height: 200,
    //                quality: 90,
    //                crop: false // crop to exact dimensions
    //            },
    filters: {
    // Maximum file size
        max_file_size: '1000mb',
        // Specify what files to browse for
        mime_types: [
            {title: "Image files", extensions: "jpg,gif,bmp,png"}
        ]
    },
    // Rename files by clicking on their titles
    rename: false,
    // Sort files
    sortable: true,
    // Enable ability to drag'n'drop files onto the widget (currently only HTML5 supports that)
    dragdrop: true,
    // Views to activate
    views: {
        list: true,
        thumbs: true, // Show thumbs
        active: 'thumbs'
    },
    // Flash settings
    flash_swf_url: "{{ URL::asset('assets/js/plupload-2.1.2/js/Moxie.swf') }}",
    // Silverlight settings
    silverlight_xap_url: "{{ URL::asset('assets/js/plupload-2.1.2/js/Moxie.xap') }}"
});
</pre>

1 个答案:

答案 0 :(得分:-2)

pl upload has init选项,在此选项下,您可以修改文件上传方法,如...

$("#uploader").plupload({
....
....
    init: {
                FilesAdded: function (up, files) {

                },
                FileUploaded: function (up, file, response) {

                },
                UploadComplete: function (up, files) {

                }
                .....
            }

});

您可以使用这些方法将上传的文件放入列表中。