Skip to content

Instantly share code, notes, and snippets.

@bhaskarkotu
Last active August 29, 2015 13:56
Show Gist options
  • Save bhaskarkotu/9048919 to your computer and use it in GitHub Desktop.
Save bhaskarkotu/9048919 to your computer and use it in GitHub Desktop.
<%= form_tag({action: 'storedata', controller: 'profileinfo'}, multipart: true) do %>
  <%= file_field_tag :file %>
<%= submit_tag %>
<% end %>
<form accept-charset="UTF-8" action="/profileinfo/storedata" enctype="multipart/form-data" method="post">
<div style="margin:0;padding:0;display:inline">
<input name="utf8" type="hidden" value="&#x2713;" />
<input name="authenticity_token" type="hidden" value="EMXCLkxw84pdO1+AWacyzti8ok8b5jDj5H6u2BmBBMc=" />
</div>
<input id="file" name="file" type="file" />
<input name="commit" type="submit" value="Save changes" />
</form>
http://stackoverflow.com/questions/11895829/uploading-file-in-rails-gives-string-filename-instead-of-file-or-stringio-object
http://guides.rubyonrails.org/v3.2.13/form_helpers.html#uploading-files
@svisamsetty
Copy link

try putting multipart:true in brackets as well
<%= form_tag({action: 'storedata', controller: 'profileinfo'}, {multipart: true}) do %>

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