String params = new String("strUserName=trxfileupload"+"&strPassword=trxfileupload"+"&strFileName="+fileName+"&base64String="+baseStr+"&strReturn=result");
url ="http://www.trx.in/m/photoupload/photoupload.asmx?op=UploadFile";
httpConn = (HttpConnection)Connector.open(url,Connector.WRITE);
// Setup HTTP Request to POST
httpConn.setRequestMethod(HttpConnection.POST);
httpConn.setRequestProperty("User-Agent","Profile/MIDP-2.0 Confirguration/CLDC-1.1");
httpConn.setRequestProperty("Accept_Language","en-US");
//byte[] postmsg = params.getBytes();
//Content-Type is must to pass parameters in POST Request
httpConn.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
httpConn.setRequestProperty("Content-Length", Integer.toString(params.length()));
//getConnectionInformation(httpConn);
os = httpConn.openOutputStream();
//os.flush();
os.write(params.getBytes());
// append("Data send");
os.flush();
StringBuffer sb = new StringBuffer();
is = new DataInputStream(httpConn.openDataInputStream());
//Display.getDisplay(midlet).setCurrent(new Alert("Exception","Data send",null,AlertType.ERROR));
int length = (int)httpConn.getLength();
byte[] data = new byte[length];
is.read(data);