[prev in list] [next in list] [prev in thread] [next in thread] 

List:       midware
Subject:    Re: [midware] Client viewing download status
From:       "Francois PIETTE" <francois.piette () skynet ! be>
Date:       2007-05-03 17:27:18
Message-ID: 011201c78dac$d7021e00$3201a8c0 () TOSHIBA2
[Download RAW message or body]

> Surely this is the correct way of doing this? My Files are XML Files with 
> a
> avg. size of 1MB

Sending file as blob field is no problem for 1MB. It is better to 
preallocate the TMWBuffer for the request and reply (AutoSize property) so 
that it has not to be enlarged (slow process because it involve copying your 
1MB of data).

> Now using this method I can access the OnSendData from the server and on 
> the
> server side I know what has been send, my question now is, is there anyway
> for the client to know what the download total is, Like a "OnReceiveData"
> for example?

No, the client doesn't know how many data will be sent, unless you dived 
your request in two: one to get the size and one to get the actual data.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
francois.piette@overbyte.be
http://www.overbyte.be



----- Original Message ----- 
From: "Billy Jacobie" <billyj@mi-c3.co.za>
To: <midware@elists.org>
Sent: Thursday, May 03, 2007 5:17 PM
Subject: Re: [midware] Midware Digest, Vol 47, Issue 2


> Ok I understand. The way I am currently doing. Is this wrong?
>
> On the server side:
> Var
>  Data  : TFileStream;
>
> Data :=FileStream.Create(ServerUserData.XMLFileDirectory+FileName_Var,
> fmOpenRead +fmShareDenyNone);
> Data.Seek(0, 0);
>    ServerUserData.DataSize := Data.Size;
>    FResponseBuffer.Rewrite;
>    FResponseBuffer.WriteFields(TRUE, [FileName_Var]);
>    FResponseBuffer.WriteStreamField(FALSE, mwString, Data);
>
>
>
> And then on the Client side:
> Var
> Data     : TFileStream;
> FieldType : TMWFieldType;
> FileName : String;
>
> FileName := XMLDownloadLocation_Var+AppSrvClient1.Answer.Fields[0];
> Write_Display(DateTimeToStr(Now)+': Saving Downloaded File to: ' 
> +FileName);
> Data := TFileStream.Create(FileName, fmCreate);
> AppSrvClient1.Answer.GetStreamField(1, Data, FieldType);
>          Write_Display('Downloaded File (Bytes:'+Inttostr(Data.Size)+') 
> to:
> ' + FileName_Var);
> Data.Destroy;
>
> Surely this is the correct way of doing this? My Files are XML Files with 
> a
> avg. size of 1MB
>
> Now using this method I can access the OnSendData from the server and on 
> the
> server side I know what has been send, my question now is, is there anyway
> for the client to know what the download total is, Like a "OnReceiveData"
> for example?
>
> -----Original Message-----

_______________________________________________
Midware mailing list [http://www.elists.org/mailman/listinfo/midware]
Visit our website at: http://www.overbyte.be

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic