Scenario: we have an app installed in Salesforce for uploading files (the maximum limit is now 1gb). While uplaoding one file or multiple files the script gives the size and it needs to compare it to server. Now I have the size in a Visualforce component, but unable to send it to server side.

Script: in visualforce component

     var fileUpload = jQuery('#fileupload'); 
     fileUpload.bind('fileuploaddone', function (e, data) {
        jQuery.each(data.files, function (index, file) {
           var size= (file.size / (1024)).toFixed(2)+"KB";

You could use an hidden input field and bind that with the controller.

<apex:inputHidden value="{!Value}" id="size"/>

Then use jquery to populate the value of the field.

$("#size").val = size;
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.