def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)
      instrument :url, key: key do |payload|
        generated_url = bucket.object_url(path_for(key), false)
        payload[:url] = generated_url
        generated_url
      end
    end
def url_for_direct_upload(key, expires_in:, content_type:, content_length:, checksum:)
      instrument :url, key: key do |payload|
        generated_url = bucket.object_url(path_for(key), false)
        payload[:url] = generated_url
        generated_url
      end
    end
You must setup CORS on OSS control panel to allow JavaScript request from your site domain.
 https://www.alibabacloud.com/help/zh/doc-detail/31988.htm
 https://help.aliyun.com/document_detail/31925.html
 Source: *.your.host.com
 Allowed Methods: POST, PUT, HEAD
 Allowed Headers: *