jquery-file-upload.html 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8" />
  5. <title>jQuery File Upload Demo</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  7. <!-- Bootstrap styles -->
  8. <link
  9. rel="stylesheet"
  10. href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"
  11. integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u"
  12. crossorigin="anonymous"
  13. />
  14. <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
  15. <link rel="stylesheet" href="./lib/jQuery-File-Upload-master/css/jquery.fileupload.css" />
  16. <link rel="stylesheet" href="./lib/jQuery-File-Upload-master/css/jquery.fileupload-ui.css" />
  17. <!-- CSS adjustments for browsers with JavaScript disabled -->
  18. <!--
  19. <noscript
  20. ><link rel="stylesheet" href="./lib/jQuery-File-Upload-master/css/jquery.fileupload-noscript.css"
  21. /></noscript>
  22. <noscript
  23. ><link rel="stylesheet" href="./lib/jQuery-File-Upload-master/css/jquery.fileupload-ui-noscript.css"
  24. /></noscript>
  25. -->
  26. </head>
  27. <body>
  28. <div class="container">
  29. <noscript><h3>You must have JavaScript enabled in order to use this site. Please enable JavaScript and then reload this page in order to continue. </h3> </noscript>
  30. <!-- The file upload form used as target for the file upload widget -->
  31. <form
  32. id="fileupload"
  33. action=""
  34. method="POST"
  35. enctype="multipart/form-data"
  36. >
  37. <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
  38. <div class="row fileupload-buttonbar">
  39. <div class="col-lg-7">
  40. <!-- The fileinput-button span is used to style the file input field as button -->
  41. <span class="btn btn-success fileinput-button">
  42. <i class="glyphicon glyphicon-plus"></i>
  43. <span>Add files...</span>
  44. <input type="file" name="files[]" multiple />
  45. </span>
  46. <button type="submit" class="btn btn-primary start">
  47. <i class="glyphicon glyphicon-upload"></i>
  48. <span>Start upload</span>
  49. </button>
  50. <button type="reset" class="btn btn-warning cancel">
  51. <i class="glyphicon glyphicon-ban-circle"></i>
  52. <span>Cancel upload</span>
  53. </button>
  54. <!-- The global file processing state -->
  55. <span class="fileupload-process"></span>
  56. </div>
  57. <!-- The global progress state -->
  58. <div class="col-lg-5 fileupload-progress fade">
  59. <!-- The global progress bar -->
  60. <div
  61. class="progress progress-striped active"
  62. role="progressbar"
  63. aria-valuemin="0"
  64. aria-valuemax="100"
  65. >
  66. <div
  67. class="progress-bar progress-bar-success"
  68. style="width: 0%;"
  69. ></div>
  70. </div>
  71. <!-- The extended global progress state -->
  72. <div class="progress-extended">&nbsp;</div>
  73. </div>
  74. </div>
  75. <!-- The table listing the files available for upload/download -->
  76. <table role="presentation" class="table table-striped">
  77. <tbody class="files"></tbody>
  78. </table>
  79. </form>
  80. </div>
  81. <!--
  82. <div class="slides"></div>
  83. <h3 class="title"></h3>
  84. <a class="prev">‹</a>
  85. <a class="next">›</a>
  86. <a class="close">×</a>
  87. <a class="play-pause"></a>
  88. <ol class="indicator"></ol>
  89. -->
  90. </div>
  91. <!-- The template to display files available for upload -->
  92. <script id="template-upload" type="text/x-tmpl">
  93. {% for (var i=0, file; file=o.files[i]; i++) { %}
  94. <tr class="template-upload fade">
  95. <td>
  96. <span class="preview"></span>
  97. </td>
  98. <td>
  99. {% if (window.innerWidth > 480 || !o.options.loadImageFileTypes.test(file.type)) { %}
  100. <p class="name">{%=file.name%}</p>
  101. {% } %}
  102. <strong class="error text-danger"></strong>
  103. </td>
  104. <td>
  105. <p class="size">Processing...</p>
  106. <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="0"><div class="progress-bar progress-bar-success" style="width:0%;"></div></div>
  107. </td>
  108. <td>
  109. {% if (!o.options.autoUpload && o.options.edit && o.options.loadImageFileTypes.test(file.type)) { %}
  110. <button class="btn btn-success edit" data-index="{%=i%}" disabled>
  111. <i class="glyphicon glyphicon-edit"></i>
  112. <span>Edit</span>
  113. </button>
  114. {% } %}
  115. {% if (!i && !o.options.autoUpload) { %}
  116. <button style="display: none" class="btn btn-primary start" disabled>
  117. <i class="glyphicon glyphicon-upload"></i>
  118. <span>Start</span>
  119. </button>
  120. {% } %}
  121. {% if (!i) { %}
  122. <button class="btn btn-warning cancel">
  123. <i class="glyphicon glyphicon-ban-circle"></i>
  124. <span>Cancel</span>
  125. </button>
  126. {% } %}
  127. </td>
  128. </tr>
  129. {% } %}
  130. </script>
  131. <!-- The template to display files available for download -->
  132. <script id="template-download" type="text/x-tmpl">
  133. {% for (var i=0, file; file=o.files[i]; i++) { %}
  134. <tr class="template-download fade">
  135. <td>
  136. <span class="preview">
  137. {% if (file.thumbnailUrl) { %}
  138. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
  139. {% } %}
  140. </span>
  141. </td>
  142. <td>
  143. {% if (window.innerWidth > 480 || !file.thumbnailUrl) { %}
  144. <p class="name">
  145. {% if (file.url) { %}
  146. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
  147. {% } else { %}
  148. <span>{%=file.name%}</span>
  149. {% } %}
  150. </p>
  151. {% } %}
  152. {% if (file.error) { %}
  153. <div><span class="label label-danger">Error</span> {%=file.error%}</div>
  154. {% } %}
  155. </td>
  156. <td>
  157. <span class="size">{%=o.formatFileSize(file.size)%}</span>
  158. </td>
  159. <td>
  160. <button class="btn btn-warning cancel">
  161. <i class="glyphicon glyphicon-ban-circle"></i>
  162. <span>Cancel</span>
  163. </button>
  164. </td>
  165. </tr>
  166. {% } %}
  167. </script>
  168. <script
  169. src="./lib/jquery-3.1.0.min.js"
  170. crossorigin="anonymous"
  171. ></script>
  172. <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
  173. <script src="./lib/jQuery-File-Upload-master/js/vendor/jquery.ui.widget.js"></script>
  174. <!-- The Templates plugin is included to render the upload/download listings -->
  175. <!--
  176. <script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
  177. -->
  178. <script src="./lib/blueimp-tmpl.min.js"></script>
  179. <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
  180. <!--
  181. <script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
  182. -->
  183. <script src="./lib/blueimp-load-image.all.min.js"></script>
  184. <!-- The Canvas to Blob plugin is included for image resizing functionality -->
  185. <!--
  186. <script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
  187. -->
  188. <script src="./lib/blueimp-canvas-to-blob.min.js"></script>
  189. <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
  190. <script src="./lib/jQuery-File-Upload-master/js/jquery.iframe-transport.js"></script>
  191. <!-- The basic File Upload plugin -->
  192. <script src="./lib/jQuery-File-Upload-master/js/jquery.fileupload.js"></script>
  193. <!-- The File Upload processing plugin -->
  194. <script src="./lib/jQuery-File-Upload-master/js/jquery.fileupload-process.js"></script>
  195. <!-- The File Upload image preview & resize plugin -->
  196. <script src="./lib/jQuery-File-Upload-master/js/jquery.fileupload-image.js"></script>
  197. <!-- The File Upload audio preview plugin -->
  198. <script src="./lib/jQuery-File-Upload-master/js/jquery.fileupload-audio.js"></script>
  199. <!-- The File Upload video preview plugin -->
  200. <script src="./lib/jQuery-File-Upload-master/js/jquery.fileupload-video.js"></script>
  201. <!-- The File Upload validation plugin -->
  202. <script src="./lib/jQuery-File-Upload-master/js/jquery.fileupload-validate.js"></script>
  203. <!-- The File Upload user interface plugin -->
  204. <script src="./lib/jQuery-File-Upload-master/js/jquery.fileupload-ui.js"></script>
  205. <!-- The main application script -->
  206. <script src="./lib/jQuery-File-Upload-master/js/f2l.js"></script>
  207. <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
  208. <!--[if (gte IE 8)&(lt IE 10)]>
  209. <script src="js/cors/jquery.xdr-transport.js"></script>
  210. <![endif]-->
  211. </body>
  212. </html>