[edit]
I’ve removed my convoluted and badly malformed question so that it doesn’t detract from the very neat and correct answer beneath. Given the (surprising) difficulty of finding an on-line example for doing this incredibly common task, I hope Yoni gets a few more up-ticks for his response.
So… the question in a nutshell…
How do I use Apache.Commons to upload a file to some destination. I’m using it in Android and uploading to a PHP script, but obviously it can work from any Java program and to any HTTP based listener.
From the api of MultipartRequestEntity:
getParams.setParameteris optional. You can also set it directly on the HttpClient instance.