Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I using this:</p> <pre><code>public class HttpClient extends AsyncTask&lt;Void, Integer, Long&gt; { private static final int PROGRESS_DIALOG = 0; public ProgressDialog dialog; public File file; protected Long doInBackground(Void... params) { for (File file : files) { foto = "/sdcard/CameraExample/" + file.getName(); DefaultHttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost(urll); MultipartEntity mpEntity = new MultipartEntity( HttpMultipartMode.BROWSER_COMPATIBLE); mpEntity.addPart("form_file", new FileBody(file, "image/jpeg")); httppost.setEntity(mpEntity); HttpResponse response; try { response = httpclient.execute(httppost); HttpEntity resEntity = response.getEntity(); if (resEntity != null) { } if (resEntity != null) { resEntity.consumeContent(); } } catch (ClientProtocolException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } return null; } protected void onPostExecute(Long unused) { progressDialog.dismiss(); ((Runnable) ctx ).run(); super.onPostExecute(unused); } protected void onPreExecute() { progressDialog = new ProgressDialog(ctx); progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDialog.setMessage("Загрузка фото..."); progressDialog.setProgress(0); progressDialog.setMax(count); progressDialog.show(); } } </code></pre> <p>This code using that library: </p> <pre><code>import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.ClientProtocolException; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.mime.HttpMultipartMode; import org.apache.http.entity.mime.MultipartEntity; import org.apache.http.entity.mime.content.FileBody; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.util.EntityUtils; import org.apache.james.mime4j.message.Message; </code></pre> <p>You can find this in Google. If you don't find - i can send you this libraries.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload