【问题标题】:How to upload images in s3 bucket using angular ng2-file-upload?如何使用 Angular ng2-file-upload 在 s3 存储桶中上传图像?
【发布时间】:2018-04-25 19:52:41
【问题描述】:

这里需要更改哪些代码才能在 s3 存储桶上上传图片。

uploader: FileUploader = new FileUploader({
    url: URL,
    disableMultipart: true,
    formatDataFunctionIsAsync: true,
    formatDataFunction: async (item) => {
      return new Promise((resolve, reject) => {
        resolve({
          name: item._file.name,
          length: item._file.size,
          contentType: item._file.type,
          date: new Date()
        });
      });
    }
  });

提前致谢。

【问题讨论】:

    标签: angularjs file-upload amazon-s3 ng2-file-upload


    【解决方案1】:

    这个方法我已经实现了。

    ngAfterViewInit() {
      // upload image on aws 
       this.uploader.onAfterAddingFile = (item => {
            // Here S3 image upload code.  
        });
    })
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-02-06
      • 2018-05-30
      • 2017-07-19
      • 2018-03-11
      • 2020-01-15
      • 2019-06-12
      • 2017-01-26
      • 1970-01-01
      相关资源
      最近更新 更多