简体   繁体   中英

Struts: Upload a file with progress bar

i want to upload files with Struts using the org.apache.struts.upload.FormFile but i would like to put a progress bar (like the gmail uploads forms or some like that), to upload the file (the files are big like 100Mb so the user must see what's going with the application). How i can do it?

Regards :)

You'll basically need to bring some shot of Ajax in so that the webbrowser and webserver can comminicate with each other asynchronously without the need to refresh/resubmit the page again and again. With Ajax the client will be able to poll the server for current progress at intervals and update the progress bar in the page accordingly.

Long story short, here's a nice blog article which covers this for the legacy Struts framework: http://kencochrane.blogspot.com/2006/03/ajax-struts-file-upload-progress-meter.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM