php code which upload the httpclient post file in java

hi

here is the java client function which post a file for upload to server

public void postAFile(String url, String filefrom){

//url="http://192.168.100.40/php_prgs/var/www/nsboxng/htdocs/tryupdate.php?filename=test.xml";

//filefrom=/home/raghavendra/Documents/test.xml;

HttpClient client = new HttpClient();

PostMethod postMethod = new PostMethod(url);

client.setConnectionTimeout(8000);

// Send any XML file as the body of the POST request

File f = new File(filefrom);

System.out.println("File Length = " + f.length());

try{

postMethod.setRequestBody(new FileInputStream(f));

postMethod.setRequestHeader("Content-type",

"text/xml; charset=ISO-8859-1");

int statusCode1 = client.executeMethod(postMethod);

System.out.println("statusLine>>>" + postMethod.getStatusLine());

// gets the response from the server

BufferedReader console = new BufferedReader(new InputStreamReader(postMethod.getResponseBodyAsStream()));

String line = null;

try {

while ((line = console.readLine()) != null) {

System.out.println("output"+line);

}

}

catch (IOException e) { }

postMethod.releaseConnection();

}

catch(IOException e){

}

}

i want to upload posted file to server using php code

can anybody please help me php code which receive this file and uploads

please help me.

[1462 byte] By [raghavan_laxa] at [2007-11-27 11:40:57]
# 1

Third thread, same quality.

http://forum.java.sun.com/thread.jspa?threadID=5198813

CeciNEstPasUnProgrammeura at 2007-7-29 17:34:58 > top of Java-index,Java Essentials,Java Programming...
# 2

I mean, hey, come on, do you really expect anyone to care if someone who writes code like "catch (IOException e) { }" yells "it doesn't work and I don't know what's wrong"?

CeciNEstPasUnProgrammeura at 2007-7-29 17:34:58 > top of Java-index,Java Essentials,Java Programming...