Module-documentation

version 1.0.0
module: uploader
maintanance: Marco Asbreuk
home
all modules

Prevent sending files

Prevent files from being sent.

Click on the button to try to select and automaticly send the selected files. You'll notice: the files are not being sent.

Note: this example does not use SPDY. Max uploadsize = 10Mb.

Code-example:

<body>
    <div id="container">
        <button id="button-send" class="pure-button pure-button-primary pure-button-bordered">Click me to select some files</button>
    </div>
    <div id="target-container"></div>
</body>
<script src="itsabuild-min.js"></script>
<script>
    var url = 'http://somedomain.com.upload',
        container = document.getElement('#target-container'),
        uploader;

    uploader = new ITSA.Uploader({url: url});

    ITSA.Event.after(
        'tap',
        function() {
            uploader.selectFiles({autoSend: true});
        },
        '#button-send'
    );

    ITSA.Event.before('uploader:send', function(e) {
        e.preventDefault();
    });

</script>
API Docs