title: AWS S3: Force File Download using 'response-content-disposition'
body: <p>Few lines(below) generate signed URL to which browser is redirected to download a file from S3.</p>
  
  <p>I am facing well known issue of Chrome not downloading pdf files from S3 when content type is set as Octet Stream.</p>
  
  <p>The solution is to force chrome to download file instead of trying to read/open it.</p>
  
  <p>I tried adding 'response-content-disposition' to sign as well as URL, but it didn't work.</p>
  
  <p>How to use 'response-content-disposition' header when url is to be generated? </p>
  
  <pre><code>    String codedFilename=  EncodingUtil.urlEncode(bucketPath,'UTF-8');
  
      String stringtosign = 'GET\n\n\n'+Lexpires+'\n/'+bucketName+'/'+codedFilename;
  
      String signed = make_sig(stringtosign); 
  
      String codedsigned = EncodingUtil.urlEncode(signed,'UTF-8');
  
      String url = serverURL+'/'+bucketName+'/'+codedFilename+'?AWSAccessKeyId='+awskey+'&amp;Expires='+Lexpires+'&amp;Signature='+codedsigned;
  </code></pre>
  
  <p>Note:- This is salesforce-apex syntax.</p>