|
Posted by Rik on 02/23/07 16:21
On Fri, 23 Feb 2007 17:10:26 +0100, Hendri Adriaens
<spotjeREMOVE@THISgmail.com> wrote:
>> Hmmmz, another solution could be, if these problems only occur with
>> small
>> files, to make the chunk size drastically maybe that helps...
>
> You mean make the chucksize very small? I guess that leads to very slow
> downloads?
Well, not really, somewhat slower, but mainly somewhat headvier on the
server.
>> Then again:
>> If the user hits cancel, but the file is already downloaded (most
>> browsers
>> start immediately), there's no way for php to distinguish that from an
>> actual download. The connection is already over & done. So if the file
>> is
>> received earlier then the user has hit the cancel button, nothing can be
>> done.
>
> Is there no way to physically start the download only if the user hit
> something else than cancel?
Nope, it's in the browser itself, the cancelling of a download isn't a
HTTP feature. You can add a dialogue on the page, or possibly something
with javascript, it will not help: the browser dialogue will still come
into play in the end.
There may be a possibility to load the file into a hidden frame or
something, and to check that with javascript. This will not help your php
script, but javascript could fire a request on succes, ans you only delete
the file on that second request. It would mean nothing get's deleted with
javascript disabled, and I'm a little bit fuzzy on the details...
Then again: I do not know what the exact purpose of you script is in
general, maybe it's OK to keep the small files and delete them
periodically after a check with filemtime()?
--
Rik Wasmus
[Back to original message]
|