1

I have strangely noticed that ajax call never execute the success function event it HttpStatus is 200 but it executes error function. Was the http header wasn't right which was responded from S3?

    downloadBlob: function(assetid, blobid, url, success, error){
        var that = this, 
        img(url, function(){alert("Succes")}, error);
},

....

    img: function(url, success, error){
        $.ajax({
            url: url,
            type: "GET",
            dataType: "blob",
            success: success,
            error: error,
        })

S3 HTTP

Remote Address:
54.239.172.104:80
Request URL:
http://dxxxxxxxxx.cloudfront.net/e7fb1b03-6d0xxxxxxxxxx4cb5464_t.jpg?Expires=1479162000&Signature=xxxxxxxxx&Key-Pair-Id=xxxxxxxxxxxxx
Request Method:
GET
Status Code:
200 OK
Response Headersview source
Accept-Ranges:
bytes
Access-Control-Allow-Methods:
GET, PUT, POST, DELETE
Access-Control-Allow-Origin:
*
Access-Control-Max-Age:
3000
Age:
1343
Connection:
keep-alive
Content-Length:
2662
Content-Type:
image/jpeg
Date:
Fri, 18 Sep 2015 15:23:53 GMT
ETag:
“xxxxxxxxxxx"
Last-Modified:
Fri, 18 Sep 2015 15:18:05 GMT
Server:
AmazonS3
Via:
1.1 xxxxxxxxxx.cloudfront.net (CloudFront)
X-Amz-Cf-Id:
1xxxxxxxxxxxxxx
x-amz-meta-attr:
{"st_ctime": 1442607482.0, "st_mtime": 1442607483.0, "st_nlink": 1, "st_mode": 33188, "st_size": 2662, "st_gid": 20, "st_uid": 501, "st_atime": 1442607483.0}
x-amz-version-id:
xxxxxxxxxxxwfVlNW
X-Cache:
Hit from cloudfront
Request Headersview source
Accept:
*/*
Accept-Encoding:
gzip, deflate, sdch
Accept-Language:
en-US,en;q=0.8
Cache-Control:
no-cache
Connection:
keep-alive
Host:
dxxxxxxxx.cloudfront.net
Origin:
http://localhost:9000
Pragma:
no-cache
Referer:
http://localhost:9000/debug.html
User-Agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.93 Safari/537.36
Query String Parametersview sourceview URL encoded
Expires:
1479162000
Signature:
xxxxxxxxxxxxxgFNqSd1K2A__
Key-Pair-Id:
xxxxxxxxxxxxxxxxA
user1595858
  • 3,700
  • 15
  • 66
  • 109
  • Probably duplicate http://stackoverflow.com/questions/17657184/using-jquerys-ajax-method-to-retrieve-images-as-a-blob and http://stackoverflow.com/questions/4285042/asychronously-load-images-with-jquery – Axel Amthor Sep 18 '15 at 16:21
  • jQuery doesn't have a data type "blob", see here http://stackoverflow.com/questions/4285042/asychronously-load-images-with-jquery – Axel Amthor Sep 18 '15 at 16:23

0 Answers0