Wednesday, August 17, 2011

[Rails] Opening a folder for file selection

Hello,
I am trying to provide a link which, when clicked, will supply a
folder which I've previously selected for users to click and open
various files in (some pdf, some .doc, maybe even .odt).

In routes.rb I put:
get 'public' => 'people#upload'

In application.html.erb I put:
<a href="http://localhost:3000/public" >Read a File</a>

And in people_controller.rb requesting a specific file works to
open the correct download window:

def upload

send_file("C:\\ -- a specific folder and file --", :disposition =>
'attachment' , :type => 'application/pdf')

end

But since I don't want to preselect a file for them, from this
preselected folder, how to I just show the folder and let the user
double-click which one they want to open in another window?
Thanks,
Barney

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate