【问题标题】:How to prevent iPhone users upload more than one image如何防止 iPhone 用户上传多张图片
【发布时间】:2014-04-29 19:12:59
【问题描述】:

我正在使用 html5/css/js 构建一个应用程序,用户可以在 div 上上传图像。在 android 上工作正常,用户单击链接,他可以选择要上传的图像。但是当我从 iPhone 中选择一张图片时,用户可以选择多个图片。如何让 iPhone 用户只选择一张图片?

我正在使用 plupload 插件,这是 js:

var uploader = new plupload.Uploader({
        browse_button: 'browse', // this can be an id of a DOM element or the DOM element itself
        url: 'upload.php',
        unique_names: true,
        filters: [{
            title: "Img type valid",
            extensions: "jpg"
        }],
        init: callbacks
    });

【问题讨论】:

    标签: javascript jquery iphone plupload


    【解决方案1】:

    Ramon,你可以使用multi_selection = false

    var uploader = new plupload.Uploader({
        browse_button: 'browse', // this can be an id of a DOM element or the DOM element itself
        url: 'upload.php',
        unique_names: true,
        multi_selection: false,
        filters: [{
            title: "Img type valid",
            extensions: "jpg"
        }],
        init: callbacks
    });
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-07-27
      • 1970-01-01
      • 2019-11-15
      相关资源
      最近更新 更多