I have 2 methods at the moment 1 to post a file, and another to post some text, they are below
Post the data...
public void postData() {
// Cre
You can use something like this:
File file = new File("FileToSend.txt");
HttpClient client = new HttpClient();
String url = "http://www.yourdomain.com/destination.php";
PostMethod postMethod = new PostMethod(url);
Part[] parts = {new FilePart(file.getName(), file)};
postMethod.setParameter("name", "value"); // set parameters like this instead in separate call
postMethod.setRequestEntity( new MultipartRequestEntity(parts, postMethod.getParams()));
int status = client.executeMethod(postMethod);