【问题标题】:How to skip Cloudinary popup for Uploading while using Cloudinary UI widget如何在使用 Cloudinary UI 小部件时跳过 Cloudinary 弹出窗口进行上传
【发布时间】:2019-03-03 03:40:11
【问题描述】:

我们正在使用 Cloudinary UI 小部件。

当用户单击要上传的按钮时,我们会显示此小部件。 一旦用户点击选择文件按钮,窗口对话框就会打开以选择文件。

但是,有没有办法绕过这个弹出窗口并直接让用户通过任何 Cloudinary 上传 UI 参数以编程方式单击选择文件按钮。

【问题讨论】:

    标签: cloudinary


    【解决方案1】:

    您可以在 div 中加载小部件。例如-

    <h2>Make sure to update cloud_name and upload_preset.</h2>
    <div id="inline_container"></div>
    <div id="thumbnails"></div>
    
    cloudinary.openUploadWidget( 
      {     
       cloud_name: 'cloud_name', 
       upload_preset: 'upload_preset', 
       cropping: 'server',
       multiple: false,
       max_files: 1,
       thumbnails: '#thumbnails',
       inline_container: "#inline_container",
       keep_widget_open: false,
       cropping_show_dimensions: true,
       sources: ['local']
      },
      function(error, result) { 
        console.log(error, result);
        if (result != null)
            $('#inline_container').html(""); // Will remove the widget after successful upload
      }
    );
    

    【讨论】:

      猜你喜欢
      • 2018-08-27
      • 1970-01-01
      • 2019-08-29
      • 2019-08-13
      • 2017-01-27
      • 2018-03-25
      • 2019-01-24
      • 2018-04-27
      • 2020-04-11
      相关资源
      最近更新 更多