July 19th, 2000, 08:21 AM
-
hello to anyone,
i have a problem! we have a download-area
on our page. now, my chief, boss, sucker (whatever) wants, that a pop-up-window appears at the moment, when a client starts to download a file. and this pop-up-window should be closed, when the download is over.
the server, on which the downloadable files are sitting, is NOT the same server, which sends the response to the client!!
does anyone know, how to handle this prob?????
many greetings
stumy
July 19th, 2000, 10:48 AM
-
You're in the wrong forum for that. That's all JavaScript/Client Side. PHP is server side.
I don't know any JavaScript, so I can't help.
July 19th, 2000, 11:11 AM
-
you don't understand me .... i'm talking about server side programming! javascript
is only a little help to realize this gimmick with the pop-up-window. how can i
see, how long it the whole (it dependence from the good or less good connection of the client) download dures???????
this has nothing to do with javascript!
regard
hans
July 19th, 2000, 01:44 PM
-
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>pop-up-window[/quote]
Right there you're already away from what a server-side code can do.
That's all I'm saying
July 20th, 2000, 11:36 AM
-
This really is more a javascript question. Although I see what you mean, Javascript is more built for this than PHP. What you should do is write a timer in Javascript that starts with the page loading, using the onLoad function, and ends with the offLoad function. I don't know exactly how you can determine when the download is actually done - that's a problem I have no clue to. But PHP isn't suited for this problem - it's timer related and more client-side.
July 20th, 2000, 12:11 PM
-
There's a algorythmn you can use to estimate download time, dependant on the client's speed. I'm not exactly sure how it goes, but I have a basic idea:
Try this (or variations of it locally)
<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
$speed = 57600; // general 56k speed
$size = fsize(file name);
$time = $speed / $size;
echo "The download will take " . strftime("h:i:s",$time);
[/code]
REMEMBER: I'm not sure if that strftime() function will work with those variables, so you'll have to correct the places where i've mistaken myself (my mind isn't on PHP at the moment
)
------------------
To alcohol! The cause of, and solution to, all of life's problems. -- Homer Simpson
[This message has been edited by cka (edited July 20, 2000).]