Uploading Sqlite database to a remote server
<p>I am collecting data using my device then save it in a local sqlite database. I am now attempting to upload this database to a remote server by the click of a button.
I have been able to upload the whole database, but the catch is that am not able to view the contents as they are encrypted using UTF-8 (if am not wrong). When i open the uploaded file the encrypted text starts with SQLite format 3 but then the other entered data is encrypted.</p>

<p>Here is a sample of my code that implements the upload, How can i get this file decrypted back to normal text/characters?</p>

<pre><code>    public void doUpload(String filepath, String filename) {
    HttpClient httpClient = new DefaultHttpClient();
    try {

httpClient.getParams().setParameter("http.socket.timeout",new Integer(90000));
        post = new HttpPost(new URI("http://10.0.2.2:8080/Force/sync"));
        File file = new File(filepath);
        FileEntity entity;
        if (filepath.substring(filepath.length() - 2, filepath.length()).equalsIgnoreCase("db" || filepath.substring(filepath.length() - 3, filepath.length()).equalsIgnoreCase("log")) {
            entity = new FileEntity(file, "text/plain; charset=\"SQLite format 3\"");
            entity.setChunked(true);                
        } else {
            entity = new FileEntity(file, "binary/octet-stream");
            entity.setChunked(true);                
        }
        post.setEntity(entity);
        post.addHeader(filepath, filename);

        HttpResponse response = httpClient.execute(post);
        if (response.getStatusLine().getStatusCode() != HttpStatus.SC_OK) {

        } else {
            // Here every thing is fine.
        }
        HttpEntity resEntity = response.getEntity();
        if (resEntity == null) {
        }
    } catch (Exception ex) {

        ex.printStackTrace();
    } finally {
        httpClient.getConnectionManager().shutdown();
    }
}
</code></pre>

<p>This code is invoked at the click of the upload button, and the url invokes a servlet (sync) that handles the uploaded file.</p>

<p>I will appreciate any asist.
Regards.</p>
