Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

329
Views
What is Java equivalent of $ curl --upload-file $uploadFileName $upload_url

I am trying to upload a zip file on amazon S3 bucket using android. But the specification I have for the upload is shown using

curl --upload-file $uploadFileName $upload_url command

I am at the moment using:

int TIMEOUT_MILLISEC = 300000;  // = 5 mints
HttpParams httpParams = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(httpParams, TIMEOUT_MILLISEC);
HttpConnectionParams.setSoTimeout(httpParams, TIMEOUT_MILLISEC);
HttpClient httpclient = new DefaultHttpClient(httpParams);
HttpPost httppost = new HttpPost(uploadURL);
entity.addPart("uploadedfile", new FileBody((sourceFile), "application/zip"));
httppost.setEntity(entity);
HttpResponse response = null;
response = httpclient.execute(httppost);
HttpEntity r_entity = response.getEntity();

in AsyncTask(). There is some progress shown instantly like 30-40% on progress bar but then

javax.net.ssl.SSLException: Write error: ssl=0x7f6f071b80: I/O error during system call, Connection reset by peer

What is the reason for this error. Is there any other way to upload zip file on to server because using

curl --upload-file

it is working (according to server side people) and I want to implement this upload functionality using Android.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

After a quick Google I found some information about it. It means that the pipe to the server is broken; in other words: the server closes the connection. This can be due a too big file upload. Could you verify that the file is not too big for the upload or try some other (perhaps smaller) file?

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!