Reputation: 563
In Sinatra, if you have a "GET /images/photo1.jpg" request... you can save a lot of time by making a "public" directory. Any route not found is assumed to be inside your "public" directory.
However this seems to work just for GET requests. Is there a way to do something similar for POST requests?
Either:
Any ideas? Is this even a bug?
PS: I know it's not RESTful to ask for files in a POST request, unfortunately Facebook works that way.
Upvotes: 0
Views: 383
Reputation: 1300
The send_file helper is what you want.
send_file "/your/file.txt", {:filename=>"foobar.dat"}
Upvotes: 0