如何在Flutter中从S3存储桶获取图像?

时间:2019-03-01 08:08:24

标签: amazon-s3 dart flutter

如何在Flutter中从S3存储桶获取图像? 我确实使用Javascript 这是我的Javascript代码,如何使用Flutter对其进行编码?

C#代码也请检查 How to generate Authentication code for S3 Bucket in Dart Flutter

if (database.empImg != null) {
  //$("#employeeImg").attr('src', '../../Employee_IMG/' + database.empImg + '?date=' + new Date());
  $.ajax({
    url: '../../webrequ/Acc/GetAuthenticationKey',
    data: {},
    dataType: "json",
    type: "GET",
    cache: false,
    success: function(data) {
      var s3Service = localStorage.getItem("S3Service");
      var siteId = localStorage.getItem("SiteId");
      var fileName2 = database.comImg;
      var Url = s3Service + "?fileName=" + result.empImg + "&siteCode=" + siteId + "&Key=" + encodeURIComponent(data);
      $("#employeeImg").attr('src', Url);
    }
  });
}

0 个答案:

没有答案