Re: [PHP] Tracking file download progress

2009-12-26 Thread STEEL
 Thanks all, I've found the solution! PHP Backend + JQuery works great!
 Just out of curiosity. Can you please tell me how you initiated the download?
Via  JSHttpRequest( JQuery started to lie %) )  to PHP backend then , in 
file downloading cycle there
are  $GLOBALS['_FULL']  tells  frontend complete size of the file, and
$GLOBALS['_GOT']  tells  clientside  how bytes are downloaded..all you
need from php is to disable output buffering,or it will not work!
And then, showing progress bar is just easy HTML  JS trick!



-- 
 STEEL  mailto:vla...@mail.kna.ru


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tracking file download progress

2009-12-24 Thread STEEL
 2009/12/24 STEEL vla...@mail.kna.ru:
 Hi all!
 Here  is  the  problem: i have PHP script that takes URL of file from
 client  and  downloads  it  to  my server. But when file is downloading,
 clients  see blank page. How can I track file download progress on the
 server  side(easier) and send result to client lively, to show it like
 a progress bar in web browser?
 Googled  around,  found  JQuery and JsHttpRequest, but can't understand
 both for my task =) If everyone knows please give me some advice

 Best regards

 If I understand your question correctly, you cannot. PHP works on the
 server-side so once you've sent your HTTP response request, you are no
 longer in control. Besides, I don't know any downloading tool that
 doesn't already show a progress bar to the user. Even wget does so.

 You can of course track how much data *you* have sent, but that
 doesn't mean the client has downloaded all of it. It may for instance
 be that the client didn't finish downloading or that it is downloading
 slower than you are sending.

 -- 
 Daniel Egeberg

Thanks for response, but seems you haven't understood:
 takes URL of file from client  and  downloads  it  to  my server.
User  don't download it at the downloading time to server, server gets
it thru PHP script and stores on itself!
ONly  i want is understand how to show progress bar to user. I have an
idea:  in  my  downloading  script in cycle add $_REQUEST['completed']
with  downloaded bytes, then at the client side via JavaScript(JQuery)
it will dynamically get data from backend variable. Would it work?



-- 
С уважением,
 STEEL  mailto:vla...@mail.kna.ru


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Tracking file download progress

2009-12-24 Thread STEEL


 On Thu, Dec 24, 2009 at 09:55, STEEL vla...@mail.kna.ru wrote:
 Thanks for response, but seems you haven't understood:
 takes URL of file from client  and  downloads  it  to  my server.
 User  don't download it at the downloading time to server, server gets
 it thru PHP script and stores on itself!
 ONly  i want is understand how to show progress bar to user. I have an
 idea:  in  my  downloading  script in cycle add $_REQUEST['completed']
 with  downloaded bytes, then at the client side via JavaScript(JQuery)
 it will dynamically get data from backend variable. Would it work?

 Oh, I see now. Sorry.

 I had this in my bookmarks: http://www.swfupload.org/

 I don't know if it's any good, but you can check it out.

 -- 
 Daniel Egeberg

Thanks all, I've found the solution! PHP Backend + JQuery works great!
And  without  eating  lot of bandwith, graph updated only once per 2
seconds and data sent by server is only about 500 bytes


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Display character 'x' times

2002-11-19 Thread Steel
Hi Tjoumaidis,

Tuesday, November 19, 2002, 1:30:39 PM, I've got:

TT Hello to everybody,

TT I just want to display a character like D x times like DDD where x is a 
TT $variable i get from the database i cannot make it work like it is on 
TT perl (i don't even know if it is working the same way) and i can't find 
TT a reference in the manual on php.net, maybe it's a silly question but i 
TT am stuck at this moment.

TT Thx in advance.


$str=str_repeat('D',$mult);
This is the equivalent of Perl's x (repetition) operator,
for eg.  str_repeat(blah, 8) in PHP does the same thing
as blah x 8 in Perl.

Answer from PHP Manual.
Comment by:
[EMAIL PROTECTED] (25-Oct-2001 11:16)

-- 
The Same,
 Steelmailto:[EMAIL PROTECTED]
   http://www.none.ru


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] MsWord html

2002-11-10 Thread Steel
Hi php-windows,

Does anybody knows, what regexp can help me remove almost all
M$ Word2000 HTML tags and styles?

Let the Force Be with Yo! ;)
-- 
The Same,
 Steel  mailto:asergey;inbox.ru
 http://www.none.ru


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Regular Expression (for ereg(i))

2002-10-14 Thread Steel

Hi Ns_Andy,

Monday, October 14, 2002, 1:27:06 PM, I've got:

N if I want eregi to return false if the string contains  char,
N for example,
N AB //false will be returned.
N what's the reg expression I can use?

eregi will return false if there is no such expression;
For Your example it will be:

eregi (^[^]+$,AB)


will return false.

-- 
The Same,
 Steelmailto:[EMAIL PROTECTED]
   http://www.none.ru


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Mail

2002-10-09 Thread Steel

Hi group,

I have a problem.
There is no sendmail on the hoster's computer. (OS Unix-like)
Can I send mail in any other way?
Please help!

-- 
The Same,
 Steel  mailto:[EMAIL PROTECTED]
 http://www.none.ru


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: unexpected T_SL

2002-09-02 Thread Steel

Hi Erwin,

Monday, September 2, 2002, 11:28:09 AM, I've got:

E Voisine wrote:
 Hi,

 What is wrong witht his code? Parse error: parse error, unexpected
 T_SL in c:\program files\easyphp\www\tutorial\eod.php on line 2

 ?php
 $str = EOD
 Example of string
 spanning multiple lines
 using heredoc syntax.
 EOD;
 ?

E To be honest, there is nothing wrong. It works in version 4.2.2 (at least,
E here it does) ;-))

E Grtz Erwin

Why not to try
?php
$str =  EOT
???

It seems to me, that EOD  - End Of Data, and EOT - End Of Text

Silly, but why not to try? :)

-- 
The Same,
 Steelmailto:[EMAIL PROTECTED]
   http://www.none.ru


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: How to escape in hidden field?

2002-09-02 Thread Steel

Hi Martin,

Monday, September 2, 2002, 2:21:10 PM, ß ïîëó÷èë:

 Using the htmlspecialchars() function, so that Hello \world\ will be
 written in pure HTML: Hello quot;worldquot;

MT Thanx a lot! But how do I get it back to 'Hello world'? Do I have to do it
MT manually?

MT Martin

Yep. But you can use some Regexp features.
EX:
$string = preg_replace(/\$quot/,\,Hello quot;worldquot;);


-- 
The Same,
 Steelmailto:[EMAIL PROTECTED]
   http://www.none.ru


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php