0

Get the attachment's size before upload it

asked 2013-08-25 04:45:21 +0800

jasonhoo gravatar image jasonhoo
104 4

I want to get the size of the attachment first, then upload it. Thanks.

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2013-08-26 05:58:42 +0800

sjoshi gravatar image sjoshi flag of India
3493 1 8
http://zkframeworkhint.bl...

If you will check ZK LINK you will get how they doing same thing which you needed, please see the Java Script Code for same they are using

<script type="text/javascript"><![CDATA[
    function testUpload(viewer) {
        for (var i = 0 ; i < 5; i ++ ) {
            (function() {
                var fakeLoader = { id: 'tmp' + new Date().getTime() + i},
                        muv = viewer == 1 ?
                        new zk.UPMSample1(fakeLoader, "TempFile" + parseInt((Math.random() + 1)*10) ):
                        new zk.UPMSample2(fakeLoader, "TempFile" + parseInt((Math.random() + 1)*10) ),
                    fsize = 12345678*Math.random() + 1;
                muv.pct = 0;
                var pgs = setInterval(function() {
                    muv.pct += parseInt(Math.random()*19);

                    if (muv.pct >= 100) {
                        clearInterval(pgs);
                        muv.pct = 100;
                    }
                    muv.update(muv.pct, fsize);
                    if (muv.pct == 100)
                        muv.destroy();
                }, 678);
            })();
        }
    }
    ]]></script>

I think we can do same from Java Code

link publish delete flag offensive edit

Comments

That's OK, thanks.

jasonhoo ( 2013-08-26 06:49:39 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2013-08-25 04:45:21 +0800

Seen: 9 times

Last updated: Aug 26 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More