Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to upload a 3gp file in server using MultiPartEntity in android?
    primarykey
    data
    text
    <p>I have to upload a 3gp audio file to my server using MultipartEntity. i am using this code but still unable to upload 3gp file.</p> <pre><code>FileInputStream is = new FileInputStream(new File(Environment.getExternalStorageDirectory().getAbsolutePath()+ "/" + nameOfFile)); byte[] data = IOUtils.toByteArray(is); InputStreamBody isb = new InputStreamBody(new ByteArrayInputStream(data),nameOfFile); HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://www.****.com/places/uploadVideo"); httppost.setHeader("Content-Type", "audio/3gpp"); MultipartEntity multipartContent = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE); multipartContent.addPart("video", isb); Log.d("Audio length", isb.getFilename()+" "+isb.getMediaType()+ isb.getMimeType()); httppost.setEntity(multipartContent); HttpResponse res =httpclient.execute(httppost); InputStream input = res.getEntity().getContent(); BufferedReader rd = new BufferedReader(new InputStreamReader(input,"UTF-8"),input.toString().length()); String line; StringBuilder sb = new StringBuilder(); while ((line = rd.readLine()) != null) { sb.append(line); } rd.close(); String uploadresponse = sb.toString(); Log.d("Upload Pic Response",uploadresponse ); </code></pre> <p>Kindly suggest me where i am making mistake?</p> <p>LogCat Response </p> <pre><code> 02-18 19:58:51.912: D/Audio length(3157): 1329575327359.3gp applicationapplication/octet-stream 02-18 19:58:52.412: D/dalvikvm(3157): GC_FOR_MALLOC freed 2359 objects / 161592 bytes in 56ms 02-18 19:58:54.002: I/Resources(3157): Loaded time zone names for en_US in 200ms. 02-18 19:58:54.012: D/Upload Pic Response(3157): &lt;strong&gt;app/controllers/places_controller.php&lt;/strong&gt; (line &lt;strong&gt;425&lt;/strong&gt;)&lt;pre class="cake-debug"&gt;Array( [controller] =&gt; places [action] =&gt; uploadVideo [named] =&gt; Array ( ) [pass] =&gt; Array ( ) [plugin] =&gt; [form] =&gt; Array ( ) [url] =&gt; Array ( [url] =&gt; places/uploadVideo ))&lt;/pre&gt;{"response":{"status":0,"mesg":"No Video data present in the request"},"data":null} </code></pre>
    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. This table or related slice is empty.
    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