Accessing external file system files


#1

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


#2

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


#3

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