Meaningless Drivel is fun!*
The moose likes Sockets and Internet Protocols and the fly likes file upload using HTTP & the Transport layer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "file upload using HTTP & the Transport layer" Watch "file upload using HTTP & the Transport layer" New topic

file upload using HTTP & the Transport layer

david allen
Ranch Hand

Joined: Sep 27, 2002
Posts: 185
Hi all,

I am working on an Applet that uploads files to a web server using HTTP. I have a status bar that reflects how much of the file has been uploaded. However, it is very inaccurate as it does not allow for the time it takes for the file to travel of the netowrk.

I am trying to find a solution to this. I have one thought.

What if I access the information form the Network Transport layer to determine how many packets are to be sent and how many ACKs have been received. Is this viable? And is it possible to get this information using java??

Van Glass
Ranch Hand

Joined: Nov 18, 2000
Posts: 110
although a good idea, i don't think it is possible using java as the java api does not give you access to that level of detail.

another option might be to have the applet poll a servlet on the server side that tells the applet how much of the file it has received, using this information to update your progress bar. yet another option is to introduce a delay at the end of the file upload from the applet, waiting for the response to come back from the server. in this case you can at least ensure that the progress bar does not disappear before the file has been uploaded.
subject: file upload using HTTP & the Transport layer
Similar Threads
transport protocol used in SOAP web services
UML interfacing
Jabber and SSL?
HTTP protocol: Connection-less or Connection-based?
Web services protocol stack