Comments (9)
Doing exactly what's done in the README's HAML example results in:
🆗, I lied. I did not set success_action_redirect
. When I do that, I get:
<Error>
<Code>AccessDenied</Code>
<Message>
Invalid according to Policy: Policy Condition failed: ["eq", "$success_action_redirect", "http://example.com"]
</Message>
<!-- snip -->
</Error>
{
"expiration": "2019-11-02T05:03:46Z",
"conditions": [
[
"starts-with",
"$key",
"sshaw/xxx"
],
{
"X-Amz-Algorithm": "AWS4-HMAC-SHA256"
},
{
"X-Amz-Credential": "xxx"
},
{
"X-Amz-Date": "20191101T190346Z"
},
{
"bucket": "xxx"
},
{
"acl": "private"
},
{
"success_action_redirect": "http://example.com"
},
[
"content-length-range",
1,
5242880
]
]
}
from carrierwave_direct.
Are you calling direct_fog_hash
?
User.new.avatar.direct_fog_hash.to_json
It's could use some documentation in the README.md
from carrierwave_direct.
Are you calling direct_fog_hash?
No. I'm doing what's in the documentation, which calls @uploader.policy
.
User.new.avatar.direct_fog_hash.to_json
This just returns a Hash of values, most of which are already used in the HTML form. Not sure of the significance here.
from carrierwave_direct.
hmm strange, It shouldn't post json. Could you post some code?
from carrierwave_direct.
hmm strange, It shouldn't post json. Could you post some code?
@p8, let me quote myself here:
Doing exactly what's done in the README's HAML example...
When you do what's given there, does it work for you?
from carrierwave_direct.
I'm using the Rails example which works for me.
The haml example should probably be something like:
%form{:action => @uploader.direct_fog_url, :method => "post", :enctype => "multipart/form-data"}
- @object.direct_fog_hash.each do |key, value|
- if key != :uri
%input{:type => "hidden", :name => key, :value => value}
%input{:type => "hidden", :name => "success_action_redirect", :value => @uploader.success_action_redirect}
%input{:name => "file", :type => "file"}
%input{:type => "submit", :value => "Upload to S3"}
from carrierwave_direct.
Thanks @p8, that works!
from carrierwave_direct.
Great! I'll change the README example
from carrierwave_direct.
So it appears the only difference between the old example and the new example is redirect URL was not included.
from carrierwave_direct.
Related Issues (20)
- One Form Action HOT 2
- Asyn upload?
- Unable to use AWS4-HMAC-SHA256 HOT 4
- does not work as expected with AWS - SignatureDoesNotMatch HOT 1
- Bypass/Disable carrierwave_direct
- It doesn't seem like the latest changes are in 2.0.0 HOT 1
- How do I combine carrierwave direct with active admin HOT 2
- FilenameFormatValidator fails for every new object HOT 6
- Need to create an upload programmatically HOT 3
- carrierwave_direct not working with rails 6 undefined method 'attr_accessible'
- Can I still upload a file from code in Rails? HOT 1
- Readme validation example are incorrect HOT 1
- Support for CarrierWave 2.2+ HOT 1
- How to Properly Configure Test Environment? HOT 2
- ActiveModel::UnknownAttributeError (unknown attribute 'key') HOT 1
- Unable to download and process image after successful direct upload to S3 HOT 1
- Limit filetypes to upload
- React integration
- Is it possible to style the button?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from carrierwave_direct.