Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

321
Vistas
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.

about 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

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?

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda