Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6948699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:51:26+00:00 2026-05-27T13:51:26+00:00

I am trying to implement the multiple uploading to Amazon S3 https://github.com/jnicklas/carrierwave/blob/master/README.md (under Using

  • 0

I am trying to implement the multiple uploading to Amazon S3 https://github.com/jnicklas/carrierwave/blob/master/README.md (under Using Amazon S3)

But I got an error inside the log file:

Started POST "/images?project_id=18" for 124.106.90.29 at Wed Dec 14 19:11:47 -0600 2011
  Processing by ImagesController#create as JS
  Parameters: {"project_id"=>"18", "authenticity_token"=>"9z0CzTtMwxgfdsyFLCNzx44qqRDT8F7+6F/RsVzUe4=", "utf8"=>"✓", "image"=>{"carimage"=>#<ActionDispatch::Http::UploadedFile:0x6eab8de86708 @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"image[carimage]\"; filename=\"stroke_holding.jpg\"\r\nContent-Type: image/jpeg\r\n", @tempfile=#<File:/tmp/RackMultipart20111214-5354-1b4qtl7-0>, @original_filename="stroke_holding.jpg">, "project_id"=>"18"}}
  [1m[35mProject Load (0.2ms)[0m  SELECT `projects`.* FROM `projects` WHERE `projects`.`id` = 18 LIMIT 1
  [1m[36m (0.1ms)[0m  [1mBEGIN[0m
  [1m[35mSQL (1.2ms)[0m  INSERT INTO `images` (`caption`, `carimage`, `created_at`, `proj_photo_content_type`, `proj_photo_file_name`, `proj_photo_file_size`, `proj_photo_updated_at`, `project_id`, `updated_at`) VALUES (NULL, 'stroke_holding.jpg', '2011-12-15 01:11:48', NULL, NULL, NULL, NULL, 18, '2011-12-15 01:11:48')
  [1m[36m (1.7ms)[0m  [1mROLLBACK[0m
Completed 500 Internal Server Error in 2635ms

Excon::Errors::MovedPermanently (Expected(200) <=> Actual(301 Moved Permanently)
  request => {:port=>"443", :method=>"PUT", :idempotent=>true, :body=>#<File:/home/ngtv2/activedesigns/public/uploads/tmp/20111214-1911-5354-1557/stroke_holding.jpg>, :headers=>{"Authorization"=>"AWS XXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXX/XXXXXXXXXXXXXXXXXXX=", "x-amz-acl"=>"public-read", "Date"=>"Thu, 15 Dec 2011 01:11:48 +0000", "Content-Type"=>"image/jpeg", "Content-Length"=>64387, "Host"=>"sample.s3-eu-west-1.amazonaws.com:443"}, :host=>"sample.s3-eu-west-1.amazonaws.com", :query=>nil, :connect_timeout=>60, :expects=>200, :read_timeout=>60, :scheme=>"https", :write_timeout=>60, :path=>"/stroke_holding.jpg", :mock=>nil}
  response => #<Excon::Response:0x6eab8c663f18 @body="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Error><Code>PermanentRedirect</Code><Message>The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.</Message><RequestId>2990AE131EF6DCE2</RequestId><Bucket>sample</Bucket><HostId>q+XXXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX</HostId><Endpoint>s3.amazonaws.com</Endpoint></Error>", @status=301, @headers={"x-amz-id-2"=>"q+XXXXXXXXXXXXXXXXXXXXXXXXXXXXX/XXXXXXXXXXXXXXXXXXX", "Transfer-Encoding"=>"chunked", "Date"=>"Thu, 15 Dec 2011 01:11:49 GMT", "Content-Type"=>"application/xml", "x-amz-request-id"=>"2990AE131EF6DCE2", "Server"=>"AmazonS3", "Connection"=>"close"}>):
  app/controllers/images_controller.rb:37:in `create'

Rendered vendor/bundle/ruby/1.8/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms)
Rendered vendor/bundle/ruby/1.8/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.0ms)
Rendered vendor/bundle/ruby/1.8/gems/actionpack-3.1.1/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (4.4ms)

Here is my line 37 in images controller:

def create
  @image = Image.new(params[:image])
  if @image.save <--------line 37
    render :json => [@image.to_jq_upload].to_json
  end
end

I also get something like this in error console:

Error: not well-formed
Source File: https://s3-console-us-standard.console.aws.amazon.com/DeliverHttp
Line: 1, Column: 1
Source Code:
{

enter image description here

config/initializers/currierwave.rb

CarrierWave.configure do |config|
    config.fog_credentials = {
        :provider               => 'AWS', 
        :aws_access_key_id      => 'XXXXXXXXXXXXXXXXXXX', 
        :aws_secret_access_key  => 'XXXXXXXXXXXXXXXXXXX', 
        :region                 => 'eu-west-1'  
    }
    config.fog_directory  = 'sample'
    config.s3_bucket = "XXXXXXXXXX"
end 

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:51:26+00:00Added an answer on May 27, 2026 at 1:51 pm

    The config.fog_directory should be set to the name of the directory on S3 (which I presume is not actually sample). The error you are getting is because you are using the ‘eu-west-1’ endpoint to try and access a bucket that is in the standard endpoint. So you should either change buckets or change regions, so that both will match.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to implement thinking-sphinx across multiple 'sites' hosted under a single rails application.
Im trying to implement pagination using multiple searching criteria. Supposed I Have student table.
I'm trying to implement the proper architecture for multiple databases under Python + Pylons.
I'm trying to implement a service with Multiple Optional Parameters using ServiceStack.Net At the
trying to implement a dialog-box style behaviour using a separate div section with all
I'm trying to implement an algorithm to search multiple XML files for a certain
I'm trying to implement a SessionState server to allow multiple web servers to share
I'm trying to implement a server-client socket program in Java that can support multiple
I am trying to implement a test project using the Point Cloud Library and
I am trying to implement a multiple file upload where I am right now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.