dongxuan2577 2013-04-03 06:24
浏览 49
已采纳

plupload会破坏图像

Im using the plupload.com/example_queuewidget.php jquery widget - but some images (mainly jpegs over 1MB) get uploaded but I can not open them. Even when manually downloading them via ftp - they are corrupted/broken. Has anyone ever had a similar problem and knows how to fix this?

Edit: Images work before uploading them.

Using the code from the example:

$("#uploader").pluploadQueue({
    // General settings
    runtimes : 'flash,gears,silverlight,browserplus,html5',
    url : '../../upload.php',
    max_file_size : '6mb',
    chunk_size : '1mb',
    unique_names : true,

    // Specify what files to browse for
    filters : [
        {title : "Image files", extensions : "jpg,gif,png"}
    ],

    // Flash settings
    flash_swf_url : '/assets/script/plupload/plupload.flash.swf',

    // Silverlight settings
    silverlight_xap_url : '/assets/script/plupload/plupload.silverlight.xap'

});



// Client side form validation
$('form#galerie_upload').submit(function(e) {
    var uploader = $('#uploader').pluploadQueue();

    // Files in queue upload them first
    if (uploader.files.length > 0) {
        // When all files are uploaded submit form
        uploader.bind('StateChanged', function() {
            if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {
                $('form#galerie_upload')[0].submit();
            }
        });

        uploader.start();
    } else {
        alert('You must queue at least one file.');
    }

    return false;
});

upload.php is the example upload.php from here

Hope someone stumbled over this already.

have a nice day!

  • 写回答

1条回答 默认 最新

  • dsfo22654 2013-04-16 09:56
    关注

    Mistake was in another script, that cut the images after they had been uploaded. Code as I posted it works!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 关于#linux#的问题(输入输出错误):出现这个界面接着我重新装系统,又让修电脑的师傅帮我扫描硬盘(没有问题)用着用着又卡死(相关搜索:固态硬盘)
  • ¥15 cv::resize不同线程时间不同
  • ¥15 web课程,怎么做啊😭没好好听课 根本不知道怎么下手
  • ¥15 做一个关于单片机的比较难的代码,然后搞一个PPT进行解释
  • ¥15 python提取.csv文件中的链接会经常出现爬取失败
  • ¥15 数据结构中的数组地址问题
  • ¥15 maya的mel里,怎样先选择模型A,然后利用mel脚本自动选择有相同名字的模型B呢。
  • ¥15 Python题,根本不会啊
  • ¥15 会会信号与系统和python的来
  • ¥15 关于#python#的问题