• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

File Uploader with a progress bar in Struts2

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.visualbuilder.com/jsp/struts/tutorial/modules-example-2/
 
fres nillo
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Catch Ernie! Catch the egg! And catch this tiny ad too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic