Is already fixed! Sorry I had a forum with the solution here! URL: http://www.nabble.com/visualizing-upload-download-status-in-a-statusbar-td19685137.html
Thank you metalheart2003 wrote: > > Hello, I am doing an upload of my applet has my website, > I works very well but I do not like putting a bar of Progress! > (JPROGRESSBAR)! > CAN PLEASE HELP ME! > UPLOAD MY CODE! > > > > String targetURL = "http://localhost/swfupload/demos/swfobjectdemo/upload. > aspx"; > PostMethod filePost = new PostMethod(targetURL); > filePost.getParams().setBooleanParameter(HttpMethodParams.US > E_EXPECT_CONTINUE,true); > try { > File targetFile = new File("C:\\temp\\pruebas\\1_MOV01114.rar"); // > FICHERO > > UploadFichero.consola("Uploading " + targetFile.getName() + " to " + > targetURL); > Part[] parts = {new FilePart("file", targetFile)}; //PARAMETROS > > filePost.setRequestEntity( > &nbs p; new MultipartRequestEntity(parts, > &nbs p; filePost.getParams()) > &nbs p; ); > > HttpClient client = new HttpClient(); > client.getHttpConnectionManager().getParams().setConnectionT > imeout(50000); > // ---------------------- > // ---------------------- > // HE IS DOING IN THIS LINE THE UPLOAD! HERE I HAVE TO MAKE THE CHANGE FOR > PROGRESS, BUT HOW AND WHERE? > int status = client.executeMethod(filePost); > > if (status == HttpStatus.SC_OK) { > &nbs p; UploadFichero.consola("Upload complete, response=" + > filePost.getResponseBodyAsString() ); > } else { > &nbs p; UploadFichero.consola("Upload failed, response=" + > HttpStatus.getStatusText(status) ); > } > } catch (Exception ex) { > UploadFichero.consola("Error: " + ex.getMessage()); > ex.printStackTrace(); > } finally { > filePost.releaseConnection(); > } > -- View this message in context: http://www.nabble.com/httpclient---upload-progress-tp23410144p23423341.html Sent from the HttpClient-User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
