未设置AWS S3内容元数据作为响应

时间:2015-07-13 22:10:47

标签: amazon-web-services amazon-s3

特别是,问题在于图片和override func viewDidLoad() { super.viewDidLoad() self.scroll() } func scroll() { var theImage = UIImage(named: "myimage.jpg")! var pattern = UIColor(patternImage: theImage) var layer = CALayer() layer.backgroundColor = pattern.CGColor layer.transform = CATransform3DMakeScale(1,-1,1) layer.anchorPoint = CGPointMake(0, 1) // i'm making the view large here so the animation can keep running smoothly without // showing what is behind our image // is there a better way to do this? var viewSize = CGSizeMake(self.view.bounds.size.height * 10, self.view.bounds.size.width * 10) layer.frame = CGRectMake(0,0, theImage.size.width + viewSize.width, viewSize.height) self.view.layer.addSublayer(layer) var startPoint = CGPointMake(-theImage.size.width, -theImage.size.height) var endPoint = CGPointMake(0, 0) var animation = CABasicAnimation(keyPath: "position") animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionLinear) animation.fromValue = NSValue(CGPoint:startPoint) animation.toValue = NSValue(CGPoint:endPoint) animation.repeatCount = Float.infinity animation.duration = 3.0 layer.addAnimation(animation, forKey: "position") }

我尝试使用不同的方法上传.png类型的图片:

  1. "上传"使用带有默认上载选项的S3管理控制台;
  2. "上传"使用管理控制台为S3显式设置内容 输入元数据详细信息;
  3. 使用https://github.com/pkgcloud
  4. 所有三个使用适当的元数据保存内容,如下所示:

    enter image description here。 但是,如果您尝试通过S3 http链接访问它,则不会设置"Content-Type: image/png"

    有一种解决方法,但似乎总是不起作用:打开S3的管理控制台并按"保存"。

    它是否与S3元数据存在问题,或者是否应该采取其他措施使元数据正确添加到响应中?

    P.S。也在这里交叉发布:https://forums.aws.amazon.com/thread.jspa?threadID=195391&tstart=0

0 个答案:

没有答案