I've uploaded a zip file to S3. The zip file contains a compressed json file.
How do I open this zip file and get the json content?
$.ajax({
url: "url/list.zip",
data: {},
type: "GET",
success: function(data) {
var result = JSON.parse(data);
$.each(result, function(i, res) {
map[res.s] = res;
results.push(res.s);
});
}
});
One solution I found was to set the proper metadata for the file. Browsers will automatically do its thing to decompress and get you the content.
ie:
My gzip file had a json file inside. I set the content-type to "text/plain" and encoding to "gzip". I was able to get the data with no problems.
FYI I am doing all this uploading/downloading via Amazon S3.