s3_direct_upload_example icon indicating copy to clipboard operation
s3_direct_upload_example copied to clipboard

422 Unprocessable Entity on save

Open cmcguff opened this issue 11 years ago • 1 comments

The S3 upload is working fine - I can see the files on S3, but the actual save process is failing with

ActiveRecord::RecordInvalid - Validation failed: Direct upload url is invalid:

I'm not sure where to go with this, for me the model is called Import instead of Document and the field for the final file is import_file rather than upload.

The format for me looks like this:

DIRECT_UPLOAD_URL_FORMAT = %r{\Ahttps:\/\/s3\.amazonaws\.com\/#{BUCKET_NAME}\/(?<path>import_files\/.+\/(?<filename>.+))\z}.freeze

cmcguff avatar Oct 21 '14 11:10 cmcguff

Are you possibly using a virtual hosted style URL for your bucket? I.e. bucketname.s3.amazonaws.com rather than a path style URL s3.amazonaws.com/bucketname?

uberllama avatar Nov 04 '14 20:11 uberllama