-1

I am using knox from windows and my url was creating problem. I was getting 403. I found that an issue exist on knox running from windows OS. So included the workaround in client.js as mentioned in https://github.com/LearnBoost/knox/issues/56

Added a generous bucket policy also for my bucket cbc, but still I was getting 403 statusCode. I am suspecting the PATH below is still incorrect, even though the url looks fine now. I banged my head for a long time, but could not do much. What could be the problem ?

        method: 'PUT',
        path: '//thumbnail/AUSTRALIA.jpg/',
        _headers: [Object],
        _headerNames: [Object],
        _header: 'PUT //thumbnail/AUSTRALIA.jpg/ HTTP/1.1\r\nExpect: 100-continu
e\r\nx-amz-acl: public-read\r\nContent-Type: image/jpeg\r\nContent-Length: 3354\
r\nDate: Sat, 03 Mar 2012 10:51:03 GMT\r\nHost: cbc.s3.amazonaws.com\r\nA
uthorization: AWS XXXXXXXXXXXXXXXXXXX:p+VNij8+LxdfoAK8o5l4tlrM/i4=\r\nConnectio
n: keep-alive\r\n\r\n',
        _headerSent: true,
        _events: [Object],
        url: 'http://cbc.s3.amazonaws.com/thumbnail/AUSTRALIA.jpg',
ben75
  • 29,217
  • 10
  • 88
  • 134
user644745
  • 5,673
  • 9
  • 54
  • 80
  • OK. found the problem. We need not append "/" before thumbnail. removed it and it's working fine. images are getting uploaded. var req = s3Client.put('thumbnail/'+filename, { 'Content-Type': res.headers['content-type'], 'Content-Length': res.headers['content-length'] }); – user644745 Mar 03 '12 at 11:40
  • whoever downscores a question, please provide details. This is just non-sense otherwise. – user644745 Mar 03 '12 at 18:11

1 Answers1

1

Actually the problem may be the time of your server against the time on amazon s3 servers, try installing:

sudo yum install ntp
service ntpd start

to update your server to current time.

Wilduck
  • 13,822
  • 10
  • 58
  • 90
Alexandro
  • 11
  • 1