title: How to get the object url with alias name from aws s3 using CloudFront
body: <p>I am uploading files with unique id like 'd9127dfd01182afe7d34a37' as object name to amazon s3 and storing the file information with my local database including original name of the file. And I am using CloudFront url to download the file.</p>
  
  <p>If I download the file using CloudFront url file name is d9127dfd01182afe7d34a37. But I need to change file name again to it's original name wich I have in my database. I don't want to download it. I want to give the url with original name to the client(WebUI) and client can download it through url.</p>
  
  <p><strong>serverside code</strong></p>
  
  <pre><code> document_url = initialize_cloud_service(document.provider['primary']).get_object_url(document_id, expires_at, 'CloudFront' )
  
  if document_url
              item = {}
              item['id'] = document['_id'].to_s
              item['name'] = document['name']
              item['mime_type'] = document['mime_type']
              item['url'] = document_url
       return {success: true, message: MESSAGES['get_url_succuss'],data: item}.to_json
  end
  </code></pre>
  
  <p><strong>client side code</strong></p>
  
  <pre><code>download: function(response){
          file = response.data
          link = document.createElement('a');
          link.download = file.name;
          link.href = file.url;
          link.click();
      },
  </code></pre>
  
  <p>Is there any way to achieve this? Please help me out. I am using ruby on rails and mongodb as local database.
  Thanks  </p>