title: ios & s3: download image from s3 using url
body: <p>Is it possible to download image from s3 using url in iOS so I don't have to use the s3 sdk?</p>
  
  <p>It's more convenience to download the image using url and NSURLConnection.sendAsynchronousRequest, since I get the url directly.</p>
  
  <p>I tried to do so, but always get timeout error.</p>
  
  <p>If I switch the url to some other image from the web that's not in s3, I could download the image successfully.</p>
  
  <p>The s3 image could be view on the web using url directly.</p>
  
  <p>Code:</p>
  
  <pre><code>var urlString = self.thumbnailImageURL
  var imgURL: NSURL = NSURL(string: urlString)
  var request: NSURLRequest = NSURLRequest(URL: imgURL, cachePolicy: NSURLRequestCachePolicy.ReloadIgnoringLocalAndRemoteCacheData, timeoutInterval: 90)
  var urlConnection: NSURLConnection = NSURLConnection(request: request, delegate: self)
  NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue(), completionHandler:
               {(response: NSURLResponse!, data:NSData!,error:NSError!)-&gt; Void in
                    if let e: AnyObject = error {
                       println("Image Download Error: \(error.localizedDescription)")
                 }else{
  ...
  </code></pre>
  
  <p>I got "Image Download Error: The request timed out."</p>