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 :( -- Posted via http://www.ruby-forum.com/.
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 :(What are you trying to accomplish with this? Mikkel -- Posted via http://www.ruby-forum.com/.
Mikkel Bruun 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 :( > > What are you trying to accomplish with this? > > MikkelI 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. -- Posted via http://www.ruby-forum.com/.