Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="main">
- <form id="pupload" action="upload.php" method="POST" enctype="multipart/form-data">
- <fieldset class="tabulated">
- <table id="down" class="bbcode_table" cellspacing="1">
- <thead>
- <tr class="Cnorm">
- <td><input type="file" name="files[]" multiple="multiple" id="files"></td>
- </tr>
- </thead>
- <tbody>
- <tr class="Cmite">
- <td><input id="submit" class="button1" type="submit" value="Upload"></td>
- </tr>
- </tbody>
- </table>
- </fieldset>
- </form>
- <div class="progress">
- <div class="bar"></div>
- <div class="percent">0%</div>
- </div>
- {msg}
- <div id="status"></div>
- <script>
- jQuery(document).ready(function ($) {
- "use strict";
- var bar = $('.bar');
- var percent = $('.percent');
- var status = $('#status');
- $('form').ajaxForm({
- beforeSend: function() {
- status.empty();
- var percentVal = '0%';
- bar.width(percentVal);
- percent.html(percentVal);
- },
- uploadProgress: function(event, position, total, percentComplete) {
- var percentVal = percentComplete + '%';
- bar.width(percentVal);
- percent.html(percentVal);
- },
- success: function(data, statusText, xhr) {
- var percentVal = '100%';
- bar.width(percentVal);
- percent.html(percentVal);
- status.html(xhr.responseText);
- },
- error: function(xhr, statusText, err) {
- status.html(err || statusText);
- }
- });
- });
- </script>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement