From: Rüdiger Fresemann on
Hi,

I want to use an progress bar in my app, when I download a file. So I use
the cftp class to connect to the server and to download the file with
getfile().

so far, so good. But how can I see the bytes, which are transmitted to get
values for the progress bar?

Do you have an idea? Or did you made it?

Thanks for Ideas or some Examplecode

R�diger

From: Kevin on
R�diger,

I have not looked at it in a long time but think the sample FTP app will
give you what you need.

Hope this helps.

Kevin


"R�diger Fresemann" <ruediger.fresemann(a)t-online.de> wrote in message
news:hvptrn$i5e$02$1(a)news.t-online.com:

> Hi,
>
> I want to use an progress bar in my app, when I download a file. So I use
> the cftp class to connect to the server and to download the file with
> getfile().
>
> so far, so good. But how can I see the bytes, which are transmitted to get
> values for the progress bar?
>
> Do you have an idea? Or did you made it?
>
> Thanks for Ideas or some Examplecode
>
> R�diger

From: valerbru on
On 22 Giu, 10:56, Rüdiger Fresemann <ruediger.fresem...(a)t-online.de>
wrote:
> Ciao,
>
> Voglio usare una barra di avanzamento nella mia app, quando si scarica un file. Così ho uso
> la classe cftp per connettersi al server e per scaricare il file con
> GetFile ().
>
> Fin qui, tutto bene. Ma come faccio a vedere i byte, che sono trasmessi per ottenere
> valori per la barra di avanzamento?
>
> Avete un'idea? O lo hai fatto?
>
> Grazie per idee o qualche Examplecode
>
> R diğer


STATIC FUNCTION X_GetFile(oFtp,cFileIn,cFileOut,oSelf,nSize)
LOCAL hfFTP AS PTR
LOCAL lRet AS LOGIC
LOCAL n AS INT
LOCAL hfLocal AS PTR
LOCAL pBuff AS PTR
LOCAL cMess AS STRING
LOCAL oBar AS QBar
*
hfFTP := oFTP:OpenFile(cFileIn, GENERIC_READ ,
FTP_TRANSFER_TYPE_BINARY )
pBuff := MemAlloc(MAX_BUFF_SIZE)
IF (hfFTP != NULL_PTR .AND. pBuff != NULL_PTR)
hfLocal := FCreate(cFileOut)
IF hfLocal != NULL_PTR
n := MAX_BUFF_SIZE
lRet := TRUE
FSeek(hfFTP, 0)

oBar := QBar{oSELF,,nSize/MAX_BUFF_SIZE,'Ricezione file:
'+cFileOut}
oBar:Show(SHOWCENTERED)

DO WHILE n = MAX_BUFF_SIZE
IF !InternetReadFile(hfFTP, pBuff, MAX_BUFF_SIZE, @n)
lRet := FALSE
EXIT
ENDIF
IF n > 0
FWrite3(hfLocal, pBuff, n)
ENDIF

oBar:Update()

ENDDO
FClose(hfLocal)
oFTP:CloseFile(hfFTP)

oBar:EndBar()

ELSE
oFTP:Error := ERROR_INTERNET_INVALID_OPERATION
lRet := FALSE
ENDIF
ENDIF
MemFree(pBuff)
*
RETURN lRet
From: John Martens on
I'm using METHOD GetLowLevel from MC_Ftp built by Marc.
It's easy to get in info on time-left etc etc in this method.

John



Op 22-6-2010 10:56, R�diger Fresemann schreef:
> Hi,
>
> I want to use an progress bar in my app, when I download a file. So I
> use the cftp class to connect to the server and to download the file
> with getfile().
>
> so far, so good. But how can I see the bytes, which are transmitted to
> get values for the progress bar?
>
> Do you have an idea? Or did you made it?
>
> Thanks for Ideas or some Examplecode
>
> R�diger
From: Rüdiger Fresemann on
Thanks! I found it in the samples. That is, what i am looking for!

R�duger

"R�diger Fresemann" <ruediger.fresemann(a)t-online.de> schrieb im Newsbeitrag
news:hvptrn$i5e$02$1(a)news.t-online.com...
> Hi,
>
> I want to use an progress bar in my app, when I download a file. So I use
> the cftp class to connect to the server and to download the file with
> getfile().
>
> so far, so good. But how can I see the bytes, which are transmitted to get
> values for the progress bar?
>
> Do you have an idea? Or did you made it?
>
> Thanks for Ideas or some Examplecode
>
> R�diger