in reply to How to sleep(), or use a while() in the background?

Would you be open to alternative methods? Since you are serving up the page providing the link thru cgi, why not do the same with the file itself? Generate a url to the same script, or a different one, with a param or path_info() which is time dependent (but not just the plaintext epoch time, or your hotlinker will figure it out). Maybe generate it using Authen::OATH with a longer timestep than default. Then, in the script which serves the file, you would verify that the time parameter was still valid before serving the file.

  • Comment on Re: How to sleep(), or use a while() in the background?

Replies are listed 'Best First'.
Re^2: How to sleep(), or use a while() in the background?
by taint (Chaplain) on May 11, 2016 at 18:54 UTC
    Thanks for the reply, pryrt.

    No. I'm not at all opposed to alternate approaches. In fact, in my frustration, I seriously considered simply using some form of CAPTCHA. But in the end decided not to, as the files should appear to be available, when search engines crawl the tree, and CAPTCHA won't really reveal the files (their names/locations). While the (original) method would. The fact that the links(s) are temporary, is unknown to them. :)

    I think, because all my previous attempts end up running the sleep timer in the browser, and thereby make it appear to the (end) user, that the browser is still retrieving data from the site. That I should probably break out the timer, and unlink functions out into a separate file/module, and parametrize the timestamp generated initially, and pass it to the second script (timer/unlinker). I'll need to give this some more thought. :)

    Thanks again, pryrt, for taking the time to respond.

    --Chris

    ¡λɐp ʇɑəɹ⅁ ɐ əʌɐɥ puɐ ʻꜱdləɥ ꜱᴉɥʇ ədoH