Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

334
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda