Page 1 of 1

libURLSetStatusCallback and progress bar

Posted: Fri Sep 25, 2009 12:35 pm
by trevix
Revolution 3.5
While doing an upload on the web server, I cannot get the progress bar to update (the screen is frozen...and updated regularly only at the very end).
On the main stack I have a

Code: Select all

put ThePageContent into URL ("file:" & PagePath)
libURLSetStatusCallback "myProgress",the long ID of scrollbar "ScrollbarTC" of stack "attesa" 
on the scrollbar script I have a

Code: Select all

on  myProgress theURL,theStatus
   lock screen
   put theStatus into fld "ConnessioneFld" of stack "Attesa"
   put  the thumbPosition of scrollbar "ScrollbarTC"  of stack "attesa" into conteggio
   add 1 to conteggio
   set the thumbPosition of scrollbar "ScrollbarTC"  of stack "attesa"  to conteggio
   unlock screen
end myProgress
I tried with Screen Debug off, with a compiled application, and replacing the

Code: Select all

put theStatus into fld "ConnessioneFld" of stack "Attesa"
with

Code: Select all

put theStatus & return after msg
In this last case the msg is filled only at the and of the operation
No result without the lock unlock screen...
Any clue ?
Thanks

Anyone ?

Posted: Tue Sep 29, 2009 6:54 pm
by trevix
Any help ?
I've noticed that on OSX even a

Code: Select all

repeat with i = 1 to 10
myprogress
end repeat
does not update the scrollbar, but it does on windows (XP)
Is this a bug ?

Posted: Wed Sep 30, 2009 6:02 am
by Janschenkel
Tight loops may prevent the engine from redrawing the screen. You can insert a wait statement in your loop and this will ensure redraw.

Code: Select all

repeat with i = 1 to 10 
  myprogress
  wait 0 milliseconds
end repeat
HTH,

Jan Schenkel.

Posted: Sat Oct 03, 2009 2:07 pm
by trevix
Thanks. This helped a little bit...

Posted: Mon Oct 26, 2009 5:13 pm
by hliljegren
Have you got it working yet? If not, what is grabbing your file one the other side? If it's a php-enabled web server it is a known problem that php didn't return any status until the download is finished. I think some support was added in version 5.2 though but I haven't tried it.
If it's not php I still think your problem might be that the server is not returning any upload status.

Posted: Mon Oct 26, 2009 5:28 pm
by trevix
My web server does not have 5.2 yet, and they are not planning on upgrading yet.
I partially solved my problem because I am sending several small file, not a single big one. That is doing some "send" at the end of each upload, when the script was resuming and upgrading the bar at each upload
If I had to do a single big one, no, I could not solve it...

My web server is a Linux Red Hat. Does it matter ?

Posted: Mon Oct 26, 2009 5:39 pm
by hliljegren
I don't think that your linux version matters. I think it's your PHP version. If you also can run Perl on your server there is a working codebase here