For a site I need a demo functionality. Long story short, I need
people to be able to click a link which POST’s a file (which I, in
this instance, provide).
So far I’ve got:
<%= link_to(“Example”, new_resource_path(:uploaded_data => “files/
some.pdf”), :method => :post, :multipart => true) %>
Obviously this does not work as the :uploaded_data param contains a
string and not the file. But I am at a loss on how to fix this.
Any help is greatly appreciated.
Unfortunately I was a bit unclear in my initial post. What I want is
to POST a file to a controller. So the user never sees the file. In
effect I want to simulate a form with a file field, but with the file
field already filled out.
but you should know that you can’t upload a file that hasn’t been
previously selected through a file input due to security reasons. you
could do this only when client and server are on the same machine…
regards
harm escribió:
would work if the pdf is in the /docs folder below RAILS_ROOT