No Exception thrown on connection timeout in specific cases for File upload
<p>Following code is being used to upload files to a server.</p>

<pre><code>        public static boolean uploadFile(String serverUrl, String filePath) {
                boolean status = false;
                try {
                    File file = new File(filePath);
                HttpParams httpParameters = new BasicHttpParams();
                int timeoutConnection = 3000;
                HttpConnectionParams.setConnectionTimeout(httpParameters, timeoutConnection);
                // Set the default socket timeout (SO_TIMEOUT) 
                // in milliseconds which is the timeout for waiting for data.
                int timeoutSocket = 5000;
                HttpConnectionParams.setSoTimeout(httpParameters, timeoutSocket);
                HttpClient httpClient = new DefaultHttpClient(httpParameters);
                HttpPost postRequest = new HttpPost(serverUrl);
                FileBody bin = new FileBody(file);
                MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.STRICT);
                reqEntity.addPart(IShipdocsMobileConstants.CUSTOM_FILE_TAG, bin);
                postRequest.setEntity(reqEntity);
                HttpResponse response = httpClient.execute(postRequest);
                if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
                    status = true;
                }
               }
              catch (Exception e) {
                        status = false;
        }
    return status;
    }
</code></pre>

<p>An exception is thrown when there is no connection while a file starts to upload files but no exception is thrown when a file has already started uploading &amp; after sometime(maybe after 50% upload) , connection is lost. </p>

<p>Currently I am using both WiFi &amp; GPRS activated SIM for upload . </p>

<p>Any other parameters which needs to be added to the above code to get the Exception.</p>

<p>Any hints/suggestions welcome.</p>
