Java Applet for File Upload to PHP Script
I require a Java Applet which can upload individual or multiple files to a webserver. There are however some specific requirements which mean I cannot use one of the many existing solutions.
1. I require that the files are uploaded in small chunks over multiple HTTP connections. The chunk size should be easily defined in the HTML embed code but a typical value would be 65535 bytes.
2. Each chunk of the file needs to be uploaded in its own thread. Typically there would be 4 threads.
3. Each thread should have a time out value (eg. 10 seconds) after which time it gives up the attempted upload, returns the failed chunk to the upload queue, closes the connection and backs off (waits for a few seconds) before opening a new connection and attempting to upload another chunk. HTTP KEEP-ALIVE should be used on a per thread basis to avoid latency associated with making new connections.
4. Once all the chunks have been sent to the webserver the complete file must be rebuilt and saved to disk.
5. The upload component needs to POST variables specified in the HTML embed code so that I can integrate it with a user system at a later date.
Background information
This component is required to compliment hardware we have built which achieves high upload bandwidth using multiple satellite connections. A laptop user would typically connect to this hardware using an Ethernet cable. Our hardware load-ballances on a per connection basis (hence the requirement for multiple HTTP connections).
Defineable Variables
* Location of server side script for upload
* Chunk size
* Number of upload threads (typical would be 4 satellites)
* Timeout (per chunk)
* User Vars (key / value pairs that will be posted)
Flexability
Please feel free to suggest any approaches you feel would work better. I have not spent a great deal of time designing how this should work and there may be more sensible ways to do things.
## Deliverables
Forgot to mention -
The applet should include a simple progress bar.
The applet should be compiled for Java 1.4.2