I would like to store json file to my amazon s3 and then retrieve it with ajax request. Unfortunately it seems s3 does not allow content-type application/json....
I should save my file as text/plain and then add header with php?
Amazon S3 Select works on objects stored in CSV, JSON, or Apache Parquet format. It also works with objects that are compressed with GZIP or BZIP2 (for CSV and JSON objects only), and server-side encrypted objects.
AWS Glue retrieves data from sources and writes data to targets stored and transported in various data formats. If your data is stored or transported in the JSON data format, this document introduces you available features for using your data in AWS Glue. AWS Glue supports using the JSON format.
You can store virtually any kind of data in any format. Please refer to the Amazon Web Services Licensing Agreement for details. Q: How much data can I store in Amazon S3? The total volume of data and number of objects you can store are unlimited.
You can store JSON documents in SQL Server or SQL Database and query JSON data as in a NoSQL database. This article describes the options for storing JSON documents in SQL Server or SQL Database.
I have found the problem. I was parsing the json in the wrong way.
$.ajax({
url:"https://s3.amazonaws.com/myBucket/myfile.json",
type:"GET",
success:function(data) {
console.log(data.property)
}
})
Instead this works:
$.ajax({
url:"https://s3.amazonaws.com/myBucket/myfile.json",
type:"GET",
success:function(data) {
var obj = jQuery.parseJSON(data);
if(typeof obj =='object'){
console.log(obj.property)
}
}
})
Change Metadata 'Value' in Key:Value pair to 'Application/json' from file properties, in AWS S3 console.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With