This is a migrated thread and some comments may be shown as answers.

Display filesize beside filename

1 Answer 56 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 04 Oct 2012, 11:52 AM
Hi guys,
     How can I display the filesize next to my filename in asyncupload. Got any idea. Please share :)
thanks
Savyo

1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 04 Oct 2012, 12:03 PM
Hi Savyo,

Try the following code snippet to achieve your scenario.

ASPX:
<telerik:RadAsyncUpload ID="hh" runat="server" OnClientFileUploaded="onClientFileUploaded">
</
telerik:RadAsyncUpload>

JS:
<script type="text/javascript">
    function onClientFileUploaded(sender, args) {
        var fileLength = args.get_fileInfo().ContentLength;
        var spanElement = document.createElement("span");
        spanElement.textContent = fileLength + " bytes";
        args.get_row().appendChild(spanElement);
    }
</script>

Hope this helps.

Regards,
Princy.
Tags
General Discussions
Asked by
Savyo
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Share this question
or