Home Redirect after uploading to S3 from rails app
Reply: 0

Redirect after uploading to S3 from rails app

user830
1#
user830 Published in June 19, 2018, 4:14 pm

I have a simple file upload field:"

<form action="<%= @post.url %>" method="post" enctype="multipart/form-data" id="new_file_tag">
    <% @post.fields.each do |name, value| %>
      <input type="hidden" name="<%= name %>" value="<%= value %>"/>
    <% end %>
    <input type="file" name="file"/>
    <input type="submit" class="btn btn-awaken btn-sm">
</form>

that I took from the S3 online docs. The only issue is that it redirects to the S3 object after upload rather than simply returning to the same page.

How can I change the form to accomplish this? I tried changing the form to rails helpers, but the upload would fail due to the automatic accept-charset="UTF-8" param.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.354268 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO