2014-04-26 29 views
3

我試圖使用the KNPLabs gaufrette bundle將圖像文件上傳到S3。當我調試S3的響應時出現以下錯誤:嘗試使用gaufrette上傳到S3時出錯

The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint. 

images.mynamespace.com.s3.amazonaws.com 

我試着將base_url參數設置爲該端點,但仍然得到相同的錯誤。還有其他一些關於建議設置我也試過的區域的問題。

我試圖上傳到的桶在歐盟西部地區(愛爾蘭)。無論我嘗試什麼配置,gaufrette仍然似乎嘗試使用s3.amazonaws.com

如何正確配置gaufrette?

config.yml: 

knp_gaufrette: 
    adapters: 
     image_storage: 
      amazon_s3: 
       amazon_s3_id: mynamespace_admin.amazon_s3 
       bucket_name: %amazon_s3_bucket_name% 
       create:  false 
       options: 
        create:  true 
        directory: 'dirname' 
        region:  eu-west-1 


    filesystems: 
     image_storage: 
      adapter: image_storage 
      alias:  image_storage_filesystem 
+0

能否請你分享,你必須設置你的適配器配置文件的一部分?也適用於您必須在適配器選項中傳遞區域的區域。 – Kapil

+0

@Kapil謝謝。把整個區域端點url解決問題 – codecowboy

回答

6
I needed to set region to s3-eu-west-1.amazonaws.com 

knp_gaufrette: 
    adapters: 
     image_storage: 
      amazon_s3: 
       amazon_s3_id: mynamespace_admin.amazon_s3 
       bucket_name: %amazon_s3_bucket_name% 
       create:  false 
       options: 
        create:  true 
        directory: 'dirname' 
        region:  s3-eu-west-1.amazonaws.com 
+0

謝謝!我什至沒有得到一個錯誤....只是沒有上傳...添加該地區做了我的伎倆 - – Pez

+0

@Pex請upvote問題和答案,如果它幫助你;) – codecowboy

+0

你可以給什麼是平均使用的蓬鬆機:簡單的探索plz – ahmedbhs

相關問題