Note that there are some explanatory texts on larger screens.

plurals
  1. POFailed to upload a file to web service
    primarykey
    data
    text
    <p>I have a web service that get a audio and do some operation on it and finally returns a string ,this web service have a web page like this </p> <pre><code>&lt;form name="form1" method="post" action="Default.aspx" id="form1" enctype="multipart/form-data"&gt; &lt;input type="file" name="FileUpload3" id="FileUpload3" style="width:325px;" /&gt; &lt;input type="submit" name="Button6" value="Upload File" id="Button6" /&gt; &lt;span id="Label1"&gt;&lt;/span&gt; &lt;/form&gt; </code></pre> <p>when file choose for uploadfile3 and press upload file a same page should be reload and then show the string in span lable, I want to connect this web service by android so I tried below code to connect and upload file, the server response 200 code but no file uploads to server and no string shows, it seems that server press upload file without choosing file, what can I do? help please.</p> <pre><code>public void upLoad2Server() throws ClientProtocolException, IOException { HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost("http://11.12.13.174/file_transfer_sample/ClientWebSite/Default.aspx"); File file = new File(Environment.getExternalStorageDirectory().getPath() + "/test.wav"); ContentBody cbFile = new FileBody(file, "audio/wav"); MultipartEntity reqEntity = new MultipartEntity(); reqEntity.addPart("FileUpload3", cbFile); httppost.setEntity(reqEntity); HttpResponse response = httpclient.execute(httppost); Log.i("status", String.valueOf(response.getStatusLine())); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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