title: In S3 bucket how to properly configure files in json format to be downloaded or to be read?
body: <p>My question came out when I experienced two different behaviors in <strong>object URL</strong> from json files stored in a s3 bucket.</p>
  
  <p>Consider a json file: <em>mydata.json</em></p>
  
  <p>If I upload this file using s3 dashboard from AWS website, I am able to see data in browser: <em>//s3-us-west-2.amazonaws.com/bucket/folder/mydata.json</em>. I am also able to read this data from a different application if I create a specific configuration in s3 bucket.</p>
  
  <p>For the other hand, if I use <code>boto3</code> library for python and upload the same file in the same bucket (making file public in the process), when I click <strong>object URL</strong> it downloads the file, but it doesn't open data in browser.</p>
  
  <p>This is the code I used:</p>
  
  <pre><code># upload json file
  bucket.upload_file(path, jsonkey)
  object_acl = s3.ObjectAcl('bucket_name', jsonkey)
  bucket_response = object_acl.put(ACL='public-read')
  </code></pre>
  
  <p>I explored file properties such as metadata. When I upload file via dashboard, the metadata assigned is <code>Content-Type: application/json</code>, and via <code>boto3</code> is <code>Content-Type: binary/octet-stream</code>. I don't really know if metadata affects the <strong>object URL</strong> behavior.</p>
  
  <p>In this context, how can I properly configure files in json format to be downloaded or to be read? I mean, what is the main configuration that affects <strong>object URL</strong> behavior?</p>
  
  <p>I couldn't find a significant difference between both methods (dashboard and boto3) in properties or permissions, besides <code>Content-Type</code> in metadata. However, when I tried to change <code>Content-Type</code>, behavior was the same.</p>
  
  <p>Any other information I can provide to clarify this question, be free to ask. Thanks in advance.</p>