Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head></head>
- <body>
- <input type="file"/>
- <button>upload</button>
- <p></p>
- <script>
- var input = document.querySelector('input'),
- button = document.querySelector('button'),
- p = document.querySelector('p');
- input.addEventListener('change', function(event) {
- var files = event.target.files;
- uploader.addFiles(files);
- p.innerHTML = '';
- for (var i = 0, file; file = uploader.files[i]; i++) {
- p.innerHTML += 'file: <strong>' + file.name + '</strong> size: <strong>' + file.humanSize + '</strong>';
- }
- });
- button.addEventListener('click', function () {
- uploader.startUpload({
- url: '/url/to/upload/handler',
- concurrency: 2,
- onProgress: function(file) {},
- onCompleted: function(file, response) {}
- });
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement