I’m trying to send large files (160MB - 1.5GB) using send_file(), it’s
working perfectly except that I can’t figure out how to make the
downloads resumable.
If a download fails, I have to re-download it from scratch.
As I’m dealing with large files I can’t set :stream => false

You’ll also need to handle conditional GET (headers such as If-
Modified-Since, If-Range, etc.), send status 416 for unsatisfiable
ranges, and deal with ‘*’ ranges. You must also send ETag headers
for some browsers (Internet Explorer) to even try a Range request.

The easiest path is to serve the file directly from Apache or
lighttpd. If you’re using send_file in order to authorize downloads,
investigate modules such as lighttpd’s mod_secdownload.

I would like to have one drop down list control another so that if
list one were companies and the second were employees, then once a
selection was made in the companies drop down list, only employees of
that company would show up in the second list. Pretty standard stuff
and a good use of Ajax (I assume).

I’m not asking for an answer (unless you’d truly like to give me an
answer) but where is the best place I can look for the clearest
explanation of how that can be done?

I am re-posting this. Not only would the answer be useful to me, but
surely to a lot of other people also. As I say, I don’t need an
answer but I would like to know where to look for an answer. Trawling
has not yet brought me satisfaction.

It is 2am so this example may not be 100% correct as I am doing it from
memory.

The view will start off by populating the company select box with all
available companies. By default the employee select box will be disabled
until a company is selected. Once selected, the change to the company
select box will trigger a call to the lookup_employees method of the
controller to get the employees that are associated with the company_id
selected. On success, it will rewrite what is in the
‘employee_container’ DOM span object with the employee populated select
box.

There are some fancy things you can do like adding spinners to show
progress when the employee select box is being populated that I have not
included here. Hope this gets you off to the right start.

I am re-posting this. Not only would the answer be useful to me, but
surely to a lot of other people also. As I say, I don’t need an
answer but I would like to know where to look for an answer. Trawling
has not yet brought me satisfaction.

thanks in advance,

Ok from my understanding of your use-case, I’ve done something exactly
the same as this using DWR on a recent J2EE project, now translating
that into ruby…

You’d need to add the correct event handlers to each of your drop down
lists, so for example if you have companies / employees, you’d need some
kind of listener for companies that sent a link_to_remote onChange to
your controller, then the controller (say companies_controller) would
have a method similar to …

This method should replace the original employee_list with one
containing the correct data

I don’t know of any ‘here’s the code for exactly what you want to do’
web-sites out there, but this should get you going in the right
direction. http://script.aculo.us is always useful for seeing some AJAX
work (in rails). For the general strategy, you can look at DWR (google
for it) and they actually have an example of exactly what you want: in
Java.