使用 ng2-file-upload 上传到 Cloudinary

问题描述 投票:0回答:0

我正在尝试使用 ng2-file-upload 将图像上传到 cloudinary。 我已将端点放在 URL 中,我可以看到上传,但我收到 401 UnAuthorized 返回。 有没有使用新的 cloudinary-ng 包的例子。 我看了一个旧的例子,它使用配置并以这种方式在 URL 中传递参数,但这不再起作用了。

这是我到目前为止得到的,这是非常基本的。现在我需要在 URL 中传递 cloudinary 参数。我使用哪些属性?

const maxFileSize = 100 * 1024 * 1024; // (100MB);

this.uploader = new FileUploader({
        url: `https://api.cloudinary.com/v1_1/$movieprepper/upload`,
        isHTML5: true,
        removeAfterUpload: false,
        autoUpload: false,
        maxFileSize: maxFileSize,
        additionalParameter : {
          MediaType: 'Image',
        },
      });
angular cloudinary ng2-file-upload
© www.soinside.com 2019 - 2024. All rights reserved.