amazon web services - fix when auto upload file to s3 using php -
i'm trying create php script auto upload file bucket in aws s3, , when runing script give error message :
warning: s3::putobject(): [requesttimetooskewed] difference between request time , current time large. in f:\xampp\htdocs\tst\s3.php on line 377
upload-file.php
$bucket = '--** bucket name **--'; //include s3 class if (!class_exists('s3'))require_once('s3.php'); //aws access info if (define('awsaccesskey', 'myaccesskeyfromaws')); if (define('awssecretkey', 'mysecretkeyfromaws')); //instantiate class $s3 = new s3(awsaccesskey, awssecretkey); //here if isset $_files if(isset($_files['userfile']) && $_files['userfile'] != null) { $s3->putobjectfile($_files['userfile']['tmp_name'], $bucket , $_files['userfile']['name'], s3::acl_public_read_write) } <br><br> <form action="" method="post" enctype="multipart/form-data"> <span>upload file</span> <input type="file" name="userfile" /> <input type="submit" value="upload" /> </form>
i'll thanks.
the reason problem amazon s3 allows small time stamp variation of 15 minutes between server , requesting client.
synchronization of time between server , requesting client important have access amazon s3. rid of problem, have adjust client's timing there maximum time stamp difference of 15 minutes. set standard time , zone system, in case set localhost utc time.
Comments
Post a Comment