Uploading a file using HttpClient

All your problems with Audio, Video and Images.

Uploading a file using HttpClient

Postby jovish.edathi » Thu Oct 13, 2011 5:09 pm

I am uploadig a file to server using HttpClient and Async Task . I want to show the progress of file upload. How to get the upload % ? I am attaching my code below.

Code: Select all
   HttpClient  client = new DefaultHttpClient();
           HttpPost httppost  = new HttpPost(server url);
            FileEntity fileEntity = new FileEntity(Uploading file, "binary/octet-stream");
          httppost.setEntity(fileEntity);
           try{
              HttpResponse response = client.execute(httppost);
             }catch(Exception ex){
           ex.printStackTrace();}
         


I am doing this in doInBackground() method. I know how to update the progress but I don't know how to get the progress status?
jovish.edathi
Developer
Developer
 
Posts: 30
Joined: Mon Oct 25, 2010 8:55 am

Top

Return to Multimedia Problems

Who is online

Users browsing this forum: Exabot [Bot] and 16 guests