FTP progress bar

Vikram Singh vikramsingh at mailandnews.com
Sat Jan 11 23:17:00 EST 2003


Roger,

You should have two fields to actually enjoy the upload. Make one for
getting the command log (libUrlSetLogField log1) that will give something
like this..

220-=(<*>)=-.:. (( Welcome to PureFTPd 1.0.12 )) .:.-=(<*>)=-
220-You are user number 1 of 50 allowed.
220-Local time is now 22:54 and the load is 0.00. Server port: 21.
220 You will be disconnected after 15 minutes of inactivity.
331 User **** OK. Password required
230-User **** has group access to:  ****
230 OK. Current restricted directory is /
257 "/" is your current location
200 TYPE is now 8-bit binary
227 Entering Passive Mode (12,23,122,13,86,195)
150 Accepted data connection
226-27545.2 Mbytes free disk space
226-File successfully transferred
226 2.908 seconds (measured here), 3.71 Kbytes per second

The other field (log) referred in your urlcallback message will show
"uploading,1322,6686" etc.  i.e. the url status.

>libUrlSetStatusCallback "urlCallback", (the long id of stack "geoFTP")

Also, does the message urlcallback exist in your stack script? It is being
referred to here..

Regards
Vikram

----- Original Message ----- From: Vikram Singh
<vikramsingh at mailandnews.com>
To: <use-revolution at lists.runrev.com>
Sent: Sunday, January 12, 2003 9:14 AM
Subject: Re: FTP progress bar


> ----- Original Message -----
> From: <Roger.E.Eller at sealedair.com>
> >
> > Vikram,
> >
> > I tried your script suggestion. With some modification, I got it to
> > partially work. I have been referring to the LibUrl documention on the
> > RunRev site, but I am still having problems. The script below APPEARS to
> > send a file, and says successful, but the file is always only 58k in
size
> > and is considered corrupt by apps that try to open it. The size "should
> be"
> > at least 1 meg. Is something wrong with the syntax here?
> >
> > Is urlCallback and showStatus redundant, or do they sometimes provide
> > different information?
> >
>
>  <snip>libUrl will then send the message at the same time as it updates
the
> urlStatus value.<snip>
> I think the urlcallback message is more efficient and showstatus is
> redundant. My *guess* is that when browsers download a large page (like
this
> list)  a similar function helps them append the html data progressively..
as
> the chunks come in...
>
> > Kind Regards,
> > Roger Eller
> > roger.e.eller at sealedair.com
> >
> > on mouseUp
> >   put "ftp://tUser:tPass@my.server.com/test_file.tif" into tUrl
> >   put field "theLocalPath"&"/"&(line 1 of fld "theFileList") into tData
> >
> >   answer tData&cr&tUrl -- This shows my source & destination
> >
> >   put EMPTY into fld "Log" of stack "geoFTP" -- clear the log
> >
> >   put the long id of field "Log" of stack "geoFTP" into tField
> >   libUrlSetLogField tField
> >   libUrlSetStatusCallback "urlCallback", (the long id of stack "geoFTP")
> >
> >   libURLSetFTPMode "passive" -- a shot in the dark... trying anything
> >   libUrlFtpUpload tData, tUrl
>
> The correct syntax in your case should be ***libUrlFtpUploadFile***
because
> tdata in the above line should have been the binary (binfile url) or
> contents of the field (but it seem that the field contains the desired
> filename)  but it was just the filename.
>
> > on   showStatus
> > end mouseUp
> >
> > on showStatus
> >   put "ftp://tUser:tPass@my.server.com/test_file.tif" into tUrl
> >   put urlStatus(tUrl) into tStatus
> >   put tStatus &cr after fld "Log" of stack "geoFTP" -- show what's
> > happening
> >   if tStatus is not among the items of "uploaded,error,timeout" then
> >     send "showStatus" to me in 50 milliseconds
> >   end if
> > end showStatus
> >
> > on urlCallback pUrl, pStatus
> >   put pStatus into field "Log" of stack "geoFTP" -- show what's
happening
> > end urlCallback
> >
>
> and by the way, there is an update in my script :
>
> on urlCallback pUrl, pStatus
> put pstatus into fld status
> ..manipulate the thumbposition of the scrollbar...
> --if "loading" is item 1 of pstatus then set the thumbpos of sb 1 to (item
2
> of pstatus/item 3 of pstatus)*(the endvalue of sb 1-startvalue of sb 1)
> >>>>> Add the startvalue of sb 1 here and change the status to uploading!
>
> if "uploading" is item 1 of pstatus then set the thumbpos of sb 1 to the
> startvalue of sb 1 +(item 2
> of pstatus/item 3 of pstatus)*(the endvalue of sb 1-startvalue of sb 1)
> end urlCallback
>
> Hope it helps..
>
> Regards
> Vikram
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/use-revolution




More information about the use-livecode mailing list