This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
Author

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??

Regards
david
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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: file upload using HTTP & the Transport layer