I use Amazon S3 to store profile images for user accounts in an iOS app using swift. I can get the photos that I want to get with S3, but uploading them takes a very long time. I do not know why this is happening. Is this how S3 works, or is there a better way to do something? This is my image upload code:
let downloadingFilePath1 = NSTemporaryDirectory().stringByAppendingPathComponent("temp-download") let downloadingFileURL1 = NSURL(fileURLWithPath: downloadingFilePath1) let transferManager = AWSS3TransferManager.defaultS3TransferManager() let readRequest1 : AWSS3TransferManagerDownloadRequest = AWSS3TransferManagerDownloadRequest() readRequest1.bucket = "groopapictures" readRequest1.key = self.searchTextField.text readRequest1.downloadingFileURL = downloadingFileURL1 transferManager.download(readRequest1).continueWithBlock { (task) -> AnyObject! in println(task.error) if task.error == nil { self.ppImageView.hidden = false println("Fetched image") self.ppImageView.image = UIImage(contentsOfFile: downloadingFilePath1) } return nil }
Any help would be appreciated!
source share