Hi I am trying to send data via HTTP POST from my android application and i got java.io.FileNotFoundException ! Note : 1) i tried to send smallest data +- 1KB and it successes ! 2) in small data Server reached and data revived 3) in the 16KB , server doesn't reached - got exception while trying to get the response ! 4) full exception : java.io.FileNotFoundException: http://myserverip:80/APP/Default.aspx
Code : String connectionString = "http://" + url + ":" + port + "/" + uploadApp; URL urle = new URL(connectionString); URLConnection httppost = urle.openConnection(); connection = (HttpURLConnection) httppost; connection.setDoInput(true); connection.setDoOutput(true); connection.setConnectTimeout(1000*60*2); // 2 min connection.setRequestMethod("POST"); connection.connect(); outputStream = new BufferedOutputStream(connection.getOutputStream(), 17000); //for example start byte[] data = new byte[16000]; for(int i = 0 ; i < data.length ; i++) data[i] = 4; //for example end outputStream.write(data); outputStream.flush(); outputStream.close(); inputStream = connection.getInputStream(); // Here i got the exception !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! BufferedReader rd = new BufferedReader(new InputStreamReader(inputStream)); String tmp = rd.readLine(); rd.close(); Any Ideas !? -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en