0

阅读它在目标元素的粘贴选项中提到“还包含文件列表”的文档 http://docs.fineuploader.com/integrating/options/fineuploaderbasic.html

这是什么?有一个很好的例子如何实现这个吗?这就是我到目前为止所拥有的。#pasteimage 是一个文本框。

使用 Chrome 10.6 我需要在 jquery.fineuploader-3.4.1.js 的某个地方打开它吗

 $(document).ready(function(){
                var thumbnailuploader = new qq.FineUploader({
                    element: $('#thumbnail-fine-uploader')[0],
                    request: {
                        endpoint: '/Admin/CFC/image-uploader.cfc?method=Upload',
                        params: {
                           profileID: '<cfoutput>#profile.ID#</cfoutput>',
                           profileType:'<cfoutput>#profile.Profile_Type#</cfoutput>',
                           subDName:'<cfoutput>#DecodeforHTML(profile.Subdomain_Name)#</cfoutput>'
                                },

                    },
                    multiple: true,
                    validation: {
                        allowedExtensions: ['jpeg', 'jpg', 'gif', 'png'],
                        sizeLimit: 102400, // 100 kB = 100 * 1024 bytes
                        itemLimit: 1,
                        stopOnFirstInvalidFile: false
                    },
                    text: {
                        uploadButton: "\+ Click or Drop"
                    },
                    paste:{
                            targetElement:$('#pasteimage')
                           },

                    callbacks: {
                        onComplete: function(id, fileName, responseJSON){
                            if (responseJSON.success) {
                                $('#thumbnail-fine-uploader').append('<img src="/<cfoutput>#profile.Profile_Type#</cfoutput>/<cfoutput>#profile.ID#</cfoutput>/' + responseJSON.filename + '" alt="' + fileName + '" style="width:120px;height:120px;">');
                                $('#thumbnail-fine-uploader').append('<br/><b style="color:red;">' + responseJSON.returnedProfileID + '<br/>'+ responseJSON.returnedprofileType+'<br/>'+responseJSON.returnedsubDName+'</b>');
                            }
                        }
                    },
                    onUpload: function(id, fileName){
                        $('#file-' + id).addClass('alert-info').html('<img src="/Images/loading.gif" alt="Initializing. Please hold."> ' +
                        'Initializing ' +
                        '“' +
                        fileName +
                        '”');
                    },
                    onProgress: function(id, fileName, loaded, total){
                        if (loaded < total) {
                            progress = Math.round(loaded / total * 100) + '% of ' + Math.round(total / 1024) + ' kB';
                            $('#file-' + id).removeClass('alert-info').html('<img src="/Images/loading.gif" alt="In progress. Please hold."> ' +
                            'Uploading ' +
                            '“' +
                            fileName +
                            '” ' +
                            progress);
                        }
                        else {
                            $('#file-' + id).addClass('alert-info').html('<img src="/Images/loading.gif" alt="Saving. Please hold."> ' +
                            'Saving ' +
                            '“' +
                            fileName +
                            '”');
                        }
                    },
                })
            });
4

1 回答 1

0

粘贴目标元素可以是任何将接收粘贴图像的容器。这是您的用户将任何图像粘贴到剪贴板上的位置。没有太多可以展示的。只需在 DOM 中创建一个元素,最好是您的用户可以理解的元素是可以粘贴图像的位置。然后,将此元素设置为paste选项targetElement属性的值。如果需要,您甚至可以将document用作目标。

于 2013-04-20T03:48:49.523 回答