Shahrukh A.
Shahrukh A.

Reputation: 1101

How to track File Upload in struts2?

I am using struts2 file upload tag to upload files,

<s:form id="upform" action="upload" method="POST" enctype="multipart/form-data">
<table>
    <tr>
        <td align="right">
            Select file
        </td>
        <td>
            <s:file name="upload"/>
        </td>
        <td><s:submit/></td>
    </tr>
</table>
</s:form>

its working fine but the problem is, i want to track that, how much data is uploaded like say i have 5 mb file and i put it on uploading so how can i know that how much data is uploaded out of 5 mb or percentage. i want to track the progress of upload. There are number of jquery/ajax file uploaders, but i want to do it with struts2 file upload tag.

Thanks

Upvotes: 0

Views: 591

Answers (1)

Umesh Awasthi
Umesh Awasthi

Reputation: 23587

i don't see a direct way to do this except if you go to use either Jquery/Ajax method or go for some already plugin which take care of this.

S2 under the hood use Apache Common File Upload to perform File Upload work for you, and its interceptor will provide a wrapper so that we as end user are out of the complexity of the process. If you want to track the progress you can take help of ProgressListener.The ProgressListener may be used to display a progress bar or do stuff like that.

Upvotes: 1

Related Questions