php - Using putObject command to aliased bucket -


i've got script uploads files fine buckets. however, 1 particular bucket has been given cname can accessed directly, apparently has been assigned using cloudfront.

i'm no expert in field, basically, instead of accessing bucket via: http://mybucket.mysite.com.s3.amazonaws.com/thing.txt, allows access via: http://mybucket.mysite.com/thing.txt

it performs put fine looks of it, when response on callback, says it's done last element in array swaps bucket , endpoint around, looks this: https://s3.amazonaws.com/mybucket.mysite.com/thing.txt

however, when use other bucket uploads correctly , returns correct objecturl.

having had search around google , site, can't seem find solution magic.

i'm using older version of aws php 2 sdk, using 2.2.1.

edit: stranger still, when pass bucket through isvalidbucketname method, returns true.

just in case else ever encounters issue, problem when executing put, sdk automatically assumes trying connect bucket in region. needed specify region bucket in, in case eu_west_1, when set config array, sure provide value, eg.

$config = array(     'key' => 'your-key' ,   'secret' => 'your-secret' ,   'region' => region::eu_west_1 ); 

being sure include aws\common\enum\region in class.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -