2016-02-11 67 views

回答

0

MediaURL您可以獲得ReferenceURL,您需要保存'UIImage in your DocumentDirectory`,然後您可以獲取該路徑並將其上載到S3。

let imageName = "temp.png" 
let documentDirectory = try! NSFileManager().URLForDirectory(.DocumentDirectory, inDomain: .UserDomainMask, appropriateForURL: nil, create: true) 
let imgPathUrl: NSURL = documentDirectory.URLByAppendingPathComponent(imageName)  
let data = UIImagePNGRepresentation(UIImagePickerControllerOriginalImage) 
data!.writeToFile(imgPathUrl!.path!, atomically: true) 
print("Path \(imgPathUrl!.path!)") 

現在您可以從該路徑上傳!

+0

我想從ReferenceURL MediaURL,反正謝謝:) – coreDeviOS

+0

你不能! @coreDeviOS –

相關問題