Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8039261
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:31:00+00:00 2026-06-05T03:31:00+00:00

I have an android application in which if I there is any exception it

  • 0

I have an android application in which if I there is any exception it will write it into a file (File is stored in Device’s internal memory)….. Now i want to know if its possible to send this file to my localhost server.

Thanks in advance

EDIT: The code below is what i use to upload an image…

    try {

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        Bitmap bm=bitmap;
        bm.compress(CompressFormat.PNG, 75, bos);

        byte[] data = bos.toByteArray();

        HttpClient httpClient = new DefaultHttpClient();
        String url="192.168.1.1**";
        HttpPost postRequest = new HttpPost(url+"uploadimage");

        ByteArrayBody bab = new ByteArrayBody(data, imageName);

        MultipartEntity reqEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);

        reqEntity.addPart("uploadfile", bab);

        //reqEntity.addPart("photoCaption", new StringBody("sfsdfsdf"));

        postRequest.setEntity(reqEntity);

        HttpResponse response = httpClient.execute(postRequest);

        BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent(), "UTF-8"));

        String sResponse;

        StringBuilder s = new StringBuilder();



        while ((sResponse = reader.readLine()) != null) {

            s = s.append(sResponse);

        }

        System.out.println("Response: " + s);

    } catch (Exception e) {

        // handle exception here

        Log.e(e.getClass().getName(), e.getMessage());

    }

similarly i want to upload a file (text file).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T03:31:02+00:00Added an answer on June 5, 2026 at 3:31 am

    Now i want to know if its possible to send this file to my localhost server

    Yes, it is possible.

    Looking at your original requirement, I would like to suggest you to take a look at ACRA.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to develop an Android application which will have a local database.
Is there any way to handle when my android application goes into background and
In the Android application I have written, there is a portion which allows the
I have a requirement for building an Android mapping application onto which I will
I have this android application which uses java-javascript bridge to pick up information from
I have a Android Application which is basically uses WebView for all interaction.. How
I have an android application in which I subclassed Application class (defining MyApplication), and
I have an android application in which I have to execute some tasks at
I have been developing an Android application which sends NDEF messages via Android Beam
1.I have an android client application in which i am grabbing frames from the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.