index.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  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. <!-- Generic page styles -->
  8. <style>
  9. #navigation {
  10. margin: 10px 0;
  11. }
  12. @media (max-width: 767px) {
  13. #title,
  14. #description {
  15. display: none;
  16. }
  17. }
  18. </style>
  19. <!-- blueimp Gallery styles -->
  20. <link
  21. rel="stylesheet"
  22. href="https://blueimp.github.io/Gallery/css/blueimp-gallery.min.css"
  23. />
  24. <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
  25. <link rel="stylesheet" href="css/jquery.fileupload.css" />
  26. <link rel="stylesheet" href="css/jquery.fileupload-ui.css" />
  27. <!-- CSS adjustments for browsers with JavaScript disabled -->
  28. <noscript
  29. ><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"
  30. /></noscript>
  31. <noscript
  32. ><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"
  33. /></noscript>
  34. </head>
  35. <body>
  36. <div class="container">
  37. <!-- The file upload form used as target for the file upload widget -->
  38. <form
  39. id="fileupload"
  40. action=""
  41. method="POST"
  42. enctype="multipart/form-data"
  43. >
  44. <!-- Redirect browsers with JavaScript disabled to the origin page -->
  45. <noscript
  46. ><input
  47. type="hidden"
  48. name="redirect"
  49. value="https://blueimp.github.io/jQuery-File-Upload/"
  50. /></noscript>
  51. <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
  52. <div class="row fileupload-buttonbar">
  53. <div class="col-lg-7">
  54. <!-- The fileinput-button span is used to style the file input field as button -->
  55. <span class="btn btn-success fileinput-button">
  56. <i class="glyphicon glyphicon-plus"></i>
  57. <span>Add files...</span>
  58. <input type="file" name="files[]" multiple />
  59. </span>
  60. <button type="submit" class="btn btn-primary start">
  61. <i class="glyphicon glyphicon-upload"></i>
  62. <span>Start upload</span>
  63. </button>
  64. <button type="reset" class="btn btn-warning cancel">
  65. <i class="glyphicon glyphicon-ban-circle"></i>
  66. <span>Cancel upload</span>
  67. </button>
  68. <button type="button" class="btn btn-danger delete">
  69. <i class="glyphicon glyphicon-trash"></i>
  70. <span>Delete selected</span>
  71. </button>
  72. <input type="checkbox" class="toggle" />
  73. <!-- The global file processing state -->
  74. <span class="fileupload-process"></span>
  75. </div>
  76. <!-- The global progress state -->
  77. <div class="col-lg-5 fileupload-progress fade">
  78. <!-- The global progress bar -->
  79. <div
  80. class="progress progress-striped active"
  81. role="progressbar"
  82. aria-valuemin="0"
  83. aria-valuemax="100"
  84. >
  85. <div
  86. class="progress-bar progress-bar-success"
  87. style="width: 0%;"
  88. ></div>
  89. </div>
  90. <!-- The extended global progress state -->
  91. <div class="progress-extended">&nbsp;</div>
  92. </div>
  93. </div>
  94. <!-- The table listing the files available for upload/download -->
  95. <table role="presentation" class="table table-striped">
  96. <tbody class="files"></tbody>
  97. </table>
  98. </form>
  99. <div class="panel panel-default">
  100. <div class="panel-heading">
  101. <h3 class="panel-title">Demo Notes</h3>
  102. </div>
  103. <div class="panel-body">
  104. <ul>
  105. <li>
  106. The maximum file size for uploads in this demo is
  107. <strong>999 KB</strong> (default file size is unlimited).
  108. </li>
  109. <li>
  110. Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in
  111. this demo (by default there is no file type restriction).
  112. </li>
  113. <li>
  114. Uploaded files will be deleted automatically after
  115. <strong>5 minutes or less</strong> (demo files are stored in
  116. memory).
  117. </li>
  118. <li>
  119. You can <strong>drag &amp; drop</strong> files from your desktop
  120. on this webpage (see
  121. <a
  122. href="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support"
  123. >Browser support</a
  124. >).
  125. </li>
  126. <li>
  127. Please refer to the
  128. <a href="https://github.com/blueimp/jQuery-File-Upload"
  129. >project website</a
  130. >
  131. and
  132. <a href="https://github.com/blueimp/jQuery-File-Upload/wiki"
  133. >documentation</a
  134. >
  135. for more information.
  136. </li>
  137. <li>
  138. Built with the
  139. <a href="https://getbootstrap.com/">Bootstrap</a> CSS framework
  140. and Icons from <a href="https://glyphicons.com/">Glyphicons</a>.
  141. </li>
  142. </ul>
  143. </div>
  144. </div>
  145. </div>
  146. <!-- The blueimp Gallery widget -->
  147. <div
  148. id="blueimp-gallery"
  149. class="blueimp-gallery blueimp-gallery-controls"
  150. data-filter=":even"
  151. >
  152. <div class="slides"></div>
  153. <h3 class="title"></h3>
  154. <a class="prev">‹</a>
  155. <a class="next">›</a>
  156. <a class="close">×</a>
  157. <a class="play-pause"></a>
  158. <ol class="indicator"></ol>
  159. </div>
  160. <!-- The template to display files available for upload -->
  161. <script id="template-upload" type="text/x-tmpl">
  162. {% for (var i=0, file; file=o.files[i]; i++) { %}
  163. <tr class="template-upload fade">
  164. <td>
  165. <span class="preview"></span>
  166. </td>
  167. <td>
  168. {% if (window.innerWidth > 480 || !o.options.loadImageFileTypes.test(file.type)) { %}
  169. <p class="name">{%=file.name%}</p>
  170. {% } %}
  171. <strong class="error text-danger"></strong>
  172. </td>
  173. <td>
  174. <p class="size">Processing...</p>
  175. <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>
  176. </td>
  177. <td>
  178. {% if (!o.options.autoUpload && o.options.edit && o.options.loadImageFileTypes.test(file.type)) { %}
  179. <button class="btn btn-success edit" data-index="{%=i%}" disabled>
  180. <i class="glyphicon glyphicon-edit"></i>
  181. <span>Edit</span>
  182. </button>
  183. {% } %}
  184. {% if (!i && !o.options.autoUpload) { %}
  185. <button class="btn btn-primary start" disabled>
  186. <i class="glyphicon glyphicon-upload"></i>
  187. <span>Start</span>
  188. </button>
  189. {% } %}
  190. {% if (!i) { %}
  191. <button class="btn btn-warning cancel">
  192. <i class="glyphicon glyphicon-ban-circle"></i>
  193. <span>Cancel</span>
  194. </button>
  195. {% } %}
  196. </td>
  197. </tr>
  198. {% } %}
  199. </script>
  200. <!-- The template to display files available for download -->
  201. <script id="template-download" type="text/x-tmpl">
  202. {% for (var i=0, file; file=o.files[i]; i++) { %}
  203. <tr class="template-download fade">
  204. <td>
  205. <span class="preview">
  206. {% if (file.thumbnailUrl) { %}
  207. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
  208. {% } %}
  209. </span>
  210. </td>
  211. <td>
  212. {% if (window.innerWidth > 480 || !file.thumbnailUrl) { %}
  213. <p class="name">
  214. {% if (file.url) { %}
  215. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
  216. {% } else { %}
  217. <span>{%=file.name%}</span>
  218. {% } %}
  219. </p>
  220. {% } %}
  221. {% if (file.error) { %}
  222. <div><span class="label label-danger">Error</span> {%=file.error%}</div>
  223. {% } %}
  224. </td>
  225. <td>
  226. <span class="size">{%=o.formatFileSize(file.size)%}</span>
  227. </td>
  228. <td>
  229. {% if (file.deleteUrl) { %}
  230. <button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
  231. <i class="glyphicon glyphicon-trash"></i>
  232. <span>Delete</span>
  233. </button>
  234. <input type="checkbox" name="delete" value="1" class="toggle">
  235. {% } else { %}
  236. <button class="btn btn-warning cancel">
  237. <i class="glyphicon glyphicon-ban-circle"></i>
  238. <span>Cancel</span>
  239. </button>
  240. {% } %}
  241. </td>
  242. </tr>
  243. {% } %}
  244. </script>
  245. <script
  246. src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"
  247. integrity="sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh"
  248. crossorigin="anonymous"
  249. ></script>
  250. <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
  251. <script src="js/vendor/jquery.ui.widget.js"></script>
  252. <!-- The Templates plugin is included to render the upload/download listings -->
  253. <script src="https://blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
  254. <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
  255. <script src="https://blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
  256. <!-- The Canvas to Blob plugin is included for image resizing functionality -->
  257. <script src="https://blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
  258. <!-- blueimp Gallery script -->
  259. <script src="https://blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
  260. <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
  261. <script src="js/jquery.iframe-transport.js"></script>
  262. <!-- The basic File Upload plugin -->
  263. <script src="js/jquery.fileupload.js"></script>
  264. <!-- The File Upload processing plugin -->
  265. <script src="js/jquery.fileupload-process.js"></script>
  266. <!-- The File Upload image preview & resize plugin -->
  267. <script src="js/jquery.fileupload-image.js"></script>
  268. <!-- The File Upload audio preview plugin -->
  269. <script src="js/jquery.fileupload-audio.js"></script>
  270. <!-- The File Upload video preview plugin -->
  271. <script src="js/jquery.fileupload-video.js"></script>
  272. <!-- The File Upload validation plugin -->
  273. <script src="js/jquery.fileupload-validate.js"></script>
  274. <!-- The File Upload user interface plugin -->
  275. <script src="js/jquery.fileupload-ui.js"></script>
  276. <!-- The main application script -->
  277. <script src="js/demo.js"></script>
  278. <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
  279. <!--[if (gte IE 8)&(lt IE 10)]>
  280. <script src="js/cors/jquery.xdr-transport.js"></script>
  281. <![endif]-->
  282. </body>
  283. </html>