我想上傳圖片到我的amazonaws s3
,但是當我提交上傳我得到這個錯誤:Laravel 5.3上傳到Amazonaws錯誤
Error executing "PutObject" on " https://s3-us-west-2.amazonaws.com/ *********/1476203786.jpg"; AWS HTTP error: Client error:
PUT https://s3-us-west-2.amazonaws.com/********/1476203786.jpg
resulted in a403 Forbidden
response:SignatureDoesNotMatch
The request signature we calcul (truncated...) SignatureDoesNotMatch (client): The request signature we calculated does not match the signature you provided. Check your key and signing method. -SignatureDoesNotMatch
The request signature we calculated does not match the signature you provided. Check your key and signing method.AKIAJTRQJVWCHLVZY2PAAWS4-HMAC-SHA256 20161011T163628Z 20161011/us-west-2/s3/aws4_request
我試圖改變該地區,但沒有什麼幫助。
這是代碼上傳我的形象:
$s3 = \Storage::disk('s3');
$filePath = $imageFileName;
$s3->put($filePath, file_get_contents($image), 'public');
檢查服務器上的時間。如果您的服務器時間不準確超過幾分鐘,則可能發生這種情況。 – ceejayoz