Advertisement
Guest User

upload_template.html

a guest
Oct 31st, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.53 KB | None | 0 0
  1. <div id="main">
  2. <form id="pupload" action="upload.php" method="POST" enctype="multipart/form-data">
  3.     <fieldset class="tabulated">
  4.         <table id="down" class="bbcode_table" cellspacing="1">
  5.             <thead>
  6.                 <tr class="Cnorm">
  7.                     <td><input type="file" name="files[]" multiple="multiple" id="files"></td>
  8.                 </tr>
  9.             </thead>
  10.             <tbody>
  11.                 <tr class="Cmite">
  12.                     <td><input id="submit" class="button1" type="submit" value="Upload"></td>
  13.                 </tr>
  14.             </tbody>
  15.         </table>
  16.     </fieldset>
  17. </form>
  18. <div class="progress">  
  19.         <div class="bar"></div>  
  20.         <div class="percent">0%</div>  
  21. </div>
  22. {msg}
  23. <div id="status"></div>
  24.  
  25. <script>  
  26.     jQuery(document).ready(function ($) {
  27.     "use strict";
  28.  
  29. var bar = $('.bar');
  30. var percent = $('.percent');
  31. var status = $('#status');
  32.  
  33. $('form').ajaxForm({
  34. beforeSend: function() {
  35.     status.empty();
  36.     var percentVal = '0%';
  37.     bar.width(percentVal);
  38.     percent.html(percentVal);
  39. },
  40. uploadProgress: function(event, position, total, percentComplete) {
  41.     var percentVal = percentComplete + '%';
  42.     bar.width(percentVal);
  43.     percent.html(percentVal);
  44. },
  45. success: function(data, statusText, xhr) {
  46.     var percentVal = '100%';
  47.     bar.width(percentVal);
  48.     percent.html(percentVal);
  49.     status.html(xhr.responseText);
  50. },
  51. error: function(xhr, statusText, err) {
  52.     status.html(err || statusText);
  53. }
  54. });
  55.  
  56. });
  57. </script>
  58. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement