Is there a correct way to getting the file size when uploading an image with ASPxUploadControl? When the file is uploaded I would like to show the file size. So far I’ve not found out any sample code on how to do it via Google.
My current code:
VB.NET
<dxuc:ASPxUploadControl ID="ASPxUploadControl1" runat="server" ShowProgressPanel="True"
ClientInstanceName="CompanyLogoUpload" FileUploadMode="OnPageLoad" ValidationSettings-GeneralErrorText="Upload Failed">
<ClientSideEvents TextChanged="HandleFileInputTextChanged" FileUploadComplete="HandleFileUploadComplete" />
</dxuc:ASPxUploadControl>
ASP.NET
function HandleFileUploadComplete(e, s)
{
var imgSrc = $("img[id$=CompanyLogoImage]").attr("src");
$("img[id$=CompanyLogoImage]").attr("src", imgSrc + "1");
}
function HandleFileInputTextChanged(e, s) {
$("input[id$=UseCompanyLogoCheckBox]").attr("checked", true);
$("#ChangeLogoContainer").removeClass("overlay");
CompanyLogoUpload.Upload();
}
This blog post shows how to wire up the client side events to show the thumbnail of the uploaded image.