【发布时间】:2014-11-09 20:37:53
【问题描述】:
我正在使用 Plupload 文件插件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>
【问题讨论】:
-
您不需要 plupload 来显示现有图像,只需使用它来传输它们。可以这样想……实际文件已发送到服务器,因此 plupload 无法再对其进行任何操作
-
有一个可用的插件 [blueimp file upload] 提供此功能,但我不喜欢他们的界面。
-
plupload 插件有一个很好的界面,它适合我的需要。应该也有这个功能。
-
好的,您必须使用具有所有花里胡哨和桌面显示的那个。为现有图像复制相同的样式。做起来应该不会太难。我经常使用 plupload,但创建自己的进度条和回调
标签: php jquery html jquery-plugins plupload