libURLSetStatusCallback and progress bar

Bringing the internet highway into your project? Building FTP, HTTP, email, chat or other client solutions?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
trevix
Posts: 1064
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

libURLSetStatusCallback and progress bar

Post by trevix » Fri Sep 25, 2009 12:35 pm

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

trevix
Posts: 1064
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Anyone ?

Post by trevix » Tue Sep 29, 2009 6:54 pm

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 ?

Janschenkel
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 977
Joined: Sat Apr 08, 2006 7:47 am
Contact:

Post by Janschenkel » Wed Sep 30, 2009 6:02 am

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.
Quartam Reports & PDF Library for LiveCode
www.quartam.com

trevix
Posts: 1064
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Post by trevix » Sat Oct 03, 2009 2:07 pm

Thanks. This helped a little bit...

hliljegren
Posts: 111
Joined: Sun Aug 23, 2009 7:48 am
Contact:

Post by hliljegren » Mon Oct 26, 2009 5:13 pm

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.

trevix
Posts: 1064
Joined: Sat Feb 24, 2007 11:25 pm
Contact:

Post by trevix » Mon Oct 26, 2009 5:28 pm

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 ?

hliljegren
Posts: 111
Joined: Sun Aug 23, 2009 7:48 am
Contact:

Post by hliljegren » Mon Oct 26, 2009 5:39 pm

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

Post Reply