Forum: Ruby on Rails Accessing external file system files

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
K. Rajesh (Guest)
on 2007-03-15 19:20
(Received via mailing list)
I am getting files uploaded and into a directory inside RAILS_ROOT
called docstore. I want to provide a Download link to
http://localhost:3000/docstore/7/some_file.ext

The message I get is
Recognition failed for "/docstore/7/Accounting_Entries.xls"

Is this a routing issue? Routing is an area I have never really got
the hang of. How do I overcome this? All I want is that when the user
clicks on the Download link, he should be able to download the xls or
whatever document is being pointed to.

Regards,
Rajesh
Nelson H. (Guest)
on 2007-03-15 21:33
K. Rajesh wrote:
> I am getting files uploaded and into a directory inside RAILS_ROOT
> called docstore. I want to provide a Download link to
> http://localhost:3000/docstore/7/some_file.ext
>
> The message I get is
> Recognition failed for "/docstore/7/Accounting_Entries.xls"
>
> Is this a routing issue? Routing is an area I have never really got
> the hang of. How do I overcome this? All I want is that when the user
> clicks on the Download link, he should be able to download the xls or
> whatever document is being pointed to.
>
> Regards,
> Rajesh

It might not work because docstore is in your RAILS_ROOT which is not
accessible to the the web server.  You would have to put docstore in
RAILS_ROOT/public which would not be a good idea.  Take a look at this
site[1], it talks about how to set up file downloads.

Nelson

[1] http://www.recentrambles.com/pragmatic/view/62

---
Basedex - A Collaborative Index to organize and collect everything
related to Ruby on Rails
http://blazingrails.basedex.com/index/8
K. Rajesh (Guest)
on 2007-03-15 22:14
(Received via mailing list)
Thanks Nelson... I went through the link and I dont see any probs
making it work. For sake of completion, I'll post actual results in
here tomorrow.

Rajesh

On Mar 16, 12:33 am, Nelson H. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.