Not able to upload file #1

sahil2628 opened this Issue Nov 30, 2012 · 2 comments

3 participants


Excellent episode.I am able to upload single file with carrierwave.

But I got 403(Forbidden) error when I try to upload multiple files using jquery file upload.

When I try to upload single/multiple file I get alert box saying failed to upload and in console it says "Failed to load resource: the server responded with a status of 403 (Forbidden)" and "XMLHttpRequest cannot load Origin http://localhost:3000 is not allowed by Access-Control-Allow-Origin."

What do I need to do to fix this?

Thank you


While this demos a destroy action, from what I can tell the file once uploaded in S3 will stay there, just no longer accessible through the rails app. Seems like it would be nice if this demo showed how to delete form s3 as well, not just to add.


Indeed.. I ended up implementing this myself in the model using the following code:

before_destroy :delete_from_s3

def connect_to_s3
    s3config ={})
        :access_key_id => s3config.options[:aws_access_key_id],
        :secret_access_key => s3config.options[:aws_secret_access_key]

def delete_from_s3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment