Implementing progressbar for large webservice transfers

  • Thread starter Thread starter John Nossluap
  • Start date Start date
J

John Nossluap

I've got some code which uploads files from a client to a webservice
(using an byte array).

Anyone got a suggestion how to implement a progressbar indicating amount
of bytes that's been sent in the ongoing call to the webservice?

(I would prefer not to have to split up the files into 4kb chunks just
to be able to implement this progressbar.)
 
Hi,

John Nossluap said:
I've got some code which uploads files from a client to a webservice
(using an byte array).

Anyone got a suggestion how to implement a progressbar indicating amount
of bytes that's been sent in the ongoing call to the webservice?

(I would prefer not to have to split up the files into 4kb chunks just to
be able to implement this progressbar.)

Do you use a buffer to read the file into and later send this buffer to the
remote end , all this inside a cicle?
if so you could do it , just remember that you have to do this transfer in a
worker thread and invoke the event in the main thread.
 
Ignacio said:
Hi,



Do you use a buffer to read the file into and later send this buffer to the
remote end , all this inside a cicle?

Yeah, I've copied the file in to a byte array and am providing this byte
array to the webmethod of the web service. Not sure what you mean by a
circle since I only make one call to the webservice.
if so you could do it , just remember that you have to do this transfer in a
worker thread and invoke the event in the main thread.

Ok, how :)? Rember I'm interested receiving information about the amount
of bytes that currently been sent during the ongoing call. Not just
receiving a notification when the async. call has completed.
 
Hi,

Yeah, I've copied the file in to a byte array and am providing this byte
array to the webmethod of the web service. Not sure what you mean by a
circle since I only make one call to the webservice.

A loop I meant, but if you are sending the entire file in a unique operation
you cannot use a progressbar, you will have to split it.
 
Back
Top