Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.net.SocketException: sendto failed: EPIPE (Broken pipe) #62

Open
qadir227 opened this issue Jun 12, 2017 · 1 comment
Open

java.net.SocketException: sendto failed: EPIPE (Broken pipe) #62

qadir227 opened this issue Jun 12, 2017 · 1 comment

Comments

@qadir227
Copy link

qadir227 commented Jun 12, 2017

I am trying to upload file to my server using SimpleMultipartRequest. I am getting this issue
java.net.SocketException: sendto failed: EPIPE (Broken pipe)

Here is my code.

public void makeMultipartRequest(final String imagePath, final String requestTag, final String url, int method, final ProgressBar mProgressBar) {

        Log.e("imagePath", imagePath);
        mProgressBar.setVisibility(View.VISIBLE);
        SimpleMultiPartRequest smr = new SimpleMultiPartRequest(method, url,
                new Response.Listener<String>() {
                    @Override
                    public void onResponse(String response) {
                        Log.e("response: ", response + "onResponse");
                        try {
                            JSONObject jObj = new JSONObject(response);
                            mVolleyResponse.onVolleyResponse(url, jObj);
                            mProgressBar.setVisibility(View.GONE);

                        } catch (JSONException e) {
                            e.printStackTrace();
                        }
                    }
                }, new Response.ErrorListener() {
            @Override
            public void onErrorResponse(VolleyError error) {
                Log.e("Error: ", error.getMessage() + "Error");
                mVolleyResponse.onVolleyError(url, error);
                mProgressBar.setVisibility(View.GONE);
            }
        });

        smr.addFile("file", imagePath);

        smr.setRetryPolicy(new DefaultRetryPolicy(0,
                DefaultRetryPolicy.DEFAULT_MAX_RETRIES,
                DefaultRetryPolicy.DEFAULT_BACKOFF_MULT));
        BaseApplication.getInstance().addToRequestQueue(smr);
    }

Here is how I am calling this method.
makeMultipartRequest(image_path, fileUploadUrl[0], fileUploadUrl[1], Request.Method.POST, img_upload_loader);

My webservice is working fine in POSTMAN, Here is screen shot.
http://prntscr.com/fiyx4s

@nono7199
Copy link

can u solve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants