Can Ruby do this?

It may sound very simple:

  1. When a user request some file, the program should authorize him
  2. Then we send the file location to the browser/download manager so it
    can begin to download. (something equilvalent to PHP header (“Location:
    XXX”)
  3. Do something else before we stop the script.

The hardest part is the 3rd one, when we send back the header the script
will stopp too. I was thinking if we can just call another script right
before we send back the header, but there is a flaw in that algorithm :frowning:

vu nguyen wrote:

It may sound very simple:

  1. When a user request some file, the program should authorize him
  2. Then we send the file location to the browser/download manager so it
    can begin to download. (something equilvalent to PHP header (“Location:
    XXX”)
  3. Do something else before we stop the script.

The hardest part is the 3rd one, when we send back the header the script
will stopp too. I was thinking if we can just call another script right
before we send back the header, but there is a flaw in that algorithm :frowning:

What are you trying to accomplish with this?

Mikkel

Mikkel B. wrote:

vu nguyen wrote:

It may sound very simple:

  1. When a user request some file, the program should authorize him
  2. Then we send the file location to the browser/download manager so it
    can begin to download. (something equilvalent to PHP header (“Location:
    XXX”)
  3. Do something else before we stop the script.

The hardest part is the 3rd one, when we send back the header the script
will stopp too. I was thinking if we can just call another script right
before we send back the header, but there is a flaw in that algorithm :frowning:

What are you trying to accomplish with this?

Mikkel

I was thinking of delete .htaccess. allow user to download, the re-write
it. Err, but it’s silly anyway, I chose just to read the file and send.