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.
0938272623e1b07c8adf883d6c54a358?d=identicon&s=25 K. Rajesh (Guest)
on 2007-03-15 18: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
E0e0e58f6ab7368839e9c606249f9b36?d=identicon&s=25 Nelson Hsu (nelson)
on 2007-03-15 20: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
0938272623e1b07c8adf883d6c54a358?d=identicon&s=25 K. Rajesh (Guest)
on 2007-03-15 21: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 Hsu <rails-mailing-l...@andreas-s.net>
This topic is locked and can not be replied to.