Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

File Uploader with a progress bar in Struts2

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I want to use an file uploader with a progress bar with Struts2, which works with all internet browsers but there is a problem with that.

I had to develop an Ajax solution with a boundary to "skip" the file upload interceptor (to send data like a form.submit() ), but the solutions works only if the browser permit read the file (in IE with an ActiveXObject which calls to system file read methods, with Firefox with FileReader, in Chrome 9 in other way; but Safari, Chromium and Opera don't have support with that because it's based in File HTML5 API).

I have test develop an Flex3 & 4 solution too, but the problem is that the server has an self-signed certificated ssl connection, and Flex doesn't support this certification type.

Is there an implementation/plugin (ot is it known) that supports ssl self-signed certification with Struts2 that works in all explorers? I see that in Struts1 works with a Listener that sends to client with JSON the status data uploaded, but I didn't see nothing in Struts2 that works fine.

Thanks.
 
fres nillo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your quick response, but I don't have any idea how it's related with the question about a file uploader with progress status, please reply if I'm in a mistake.

I thought about using the interceptor execAndWait to send the progress like this (putting the progressBar in a iframe):
...
dojo.io.iframe.send({
url: ...upload.action,
method: 'post',
handleAs: 'json',
load: function(response){
var progress = response.percentComplete;
document.getElementById('progressBar').style.width = progress+"%";
});
...

I extracted that from http://stackoverflow.com/questions/4073140/strut2-execandwait-interceptor-json-result-type-dojo-dijit-progressbar-ajax, but I don't have any idea what is or where is the FileProcessor class (non ProcessFileAction).

Thanks.
    Bookmark Topic Watch Topic
  • New Topic