img.jsp 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. <%@page contentType="text/html;charset=UTF-8"%>
  2. <!DOCTYPE HTML>
  3. <html lang="en">
  4. <head>
  5. <!-- Force latest IE rendering engine or ChromeFrame if installed -->
  6. <!--[if IE]>
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <![endif]-->
  9. <meta charset="utf-8">
  10. <title>jQuery File Upload Demo</title>
  11. <meta name="description" content="File Upload widget with multiple file selection, drag&amp;drop support, progress bars, validation and preview images, audio and video for jQuery. Supports cross-domain, chunked and resumable file uploads and client-side image resizing. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
  12. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  13. <!-- Bootstrap styles -->
  14. <link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
  15. <!-- Generic page styles -->
  16. <link rel="stylesheet" href="css/style.css">
  17. <!-- blueimp Gallery styles -->
  18. <link rel="stylesheet" href="//blueimp.github.io/Gallery/css/blueimp-gallery.min.css">
  19. <!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
  20. <link rel="stylesheet" href="css/jquery.fileupload.css">
  21. <link rel="stylesheet" href="css/jquery.fileupload-ui.css">
  22. <!-- CSS adjustments for browsers with JavaScript disabled -->
  23. <noscript><link rel="stylesheet" href="css/jquery.fileupload-noscript.css"></noscript>
  24. <noscript><link rel="stylesheet" href="css/jquery.fileupload-ui-noscript.css"></noscript>
  25. </head>
  26. <body>
  27. <!-- The file upload form used as target for the file upload widget -->
  28. <form id="fileupload" action="//jquery-file-upload.appspot.com/" method="POST" enctype="multipart/form-data">
  29. <!-- Redirect browsers with JavaScript disabled to the origin page -->
  30. <noscript><input type="hidden" name="redirect" value="https://blueimp.github.io/jQuery-File-Upload/"></noscript>
  31. <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
  32. <div class="row fileupload-buttonbar">
  33. <div class="col-lg-7">
  34. <!-- The fileinput-button span is used to style the file input field as button -->
  35. <span class="btn btn-success fileinput-button">
  36. <i class="glyphicon glyphicon-plus"></i>
  37. <span>Add files...</span>
  38. <input type="file" name="files[]" multiple>
  39. </span>
  40. <button type="submit" class="btn btn-primary start">
  41. <i class="glyphicon glyphicon-upload"></i>
  42. <span>Start upload</span>
  43. </button>
  44. <button type="reset" class="btn btn-warning cancel">
  45. <i class="glyphicon glyphicon-ban-circle"></i>
  46. <span>Cancel upload</span>
  47. </button>
  48. <button type="button" class="btn btn-danger delete">
  49. <i class="glyphicon glyphicon-trash"></i>
  50. <span>Delete</span>
  51. </button>
  52. <input type="checkbox" class="toggle">
  53. <!-- The global file processing state -->
  54. <span class="fileupload-process"></span>
  55. </div>
  56. <!-- The global progress state -->
  57. <div class="col-lg-5 fileupload-progress fade">
  58. <!-- The global progress bar -->
  59. <div class="progress progress-striped active" role="progressbar" aria-valuemin="0" aria-valuemax="100">
  60. <div class="progress-bar progress-bar-success" style="width:0%;"></div>
  61. </div>
  62. <!-- The extended global progress state -->
  63. <div class="progress-extended">&nbsp;</div>
  64. </div>
  65. </div>
  66. <!-- The table listing the files available for upload/download -->
  67. <table role="presentation" class="table table-striped"><tbody class="files"></tbody></table>
  68. </form>
  69. <!-- The blueimp Gallery widget -->
  70. <div id="blueimp-gallery" class="blueimp-gallery blueimp-gallery-controls" data-filter=":even">
  71. <div class="slides"></div>
  72. <h3 class="title"></h3>
  73. <a class="prev">‹</a>
  74. <a class="next">›</a>
  75. <a class="close">×</a>
  76. <a class="play-pause"></a>
  77. <ol class="indicator"></ol>
  78. </div>
  79. <!-- The template to display files available for upload -->
  80. <script id="template-upload" type="text/x-tmpl">
  81. {% for (var i=0, file; file=o.files[i]; i++) { %}
  82. <tr class="template-upload fade">
  83. <td>
  84. <span class="preview"></span>
  85. </td>
  86. <td>
  87. <p class="name">{%=file.name%}</p>
  88. <strong class="error text-danger"></strong>
  89. </td>
  90. <td>
  91. <p class="size">Processing...</p>
  92. <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>
  93. </td>
  94. <td>
  95. {% if (!i && !o.options.autoUpload) { %}
  96. <button class="btn btn-primary start" disabled>
  97. <i class="glyphicon glyphicon-upload"></i>
  98. <span>Start</span>
  99. </button>
  100. {% } %}
  101. {% if (!i) { %}
  102. <button class="btn btn-warning cancel">
  103. <i class="glyphicon glyphicon-ban-circle"></i>
  104. <span>Cancel</span>
  105. </button>
  106. {% } %}
  107. </td>
  108. </tr>
  109. {% } %}
  110. </script>
  111. <!-- The template to display files available for download -->
  112. <script id="template-download" type="text/x-tmpl">
  113. {% for (var i=0, file; file=o.files[i]; i++) { %}
  114. <tr class="template-download fade">
  115. <td>
  116. <span class="preview">
  117. {% if (file.thumbnailUrl) { %}
  118. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" data-gallery><img src="{%=file.thumbnailUrl%}"></a>
  119. {% } %}
  120. </span>
  121. </td>
  122. <td>
  123. <p class="name">
  124. {% if (file.url) { %}
  125. <a href="{%=file.url%}" title="{%=file.name%}" download="{%=file.name%}" {%=file.thumbnailUrl?'data-gallery':''%}>{%=file.name%}</a>
  126. {% } else { %}
  127. <span>{%=file.name%}</span>
  128. {% } %}
  129. </p>
  130. {% if (file.error) { %}
  131. <div><span class="label label-danger">Error</span> {%=file.error%}</div>
  132. {% } %}
  133. </td>
  134. <td>
  135. <span class="size">{%=o.formatFileSize(file.size)%}</span>
  136. </td>
  137. <td>
  138. {% if (file.deleteUrl) { %}
  139. <button class="btn btn-danger delete" data-type="{%=file.deleteType%}" data-url="{%=file.deleteUrl%}"{% if (file.deleteWithCredentials) { %} data-xhr-fields='{"withCredentials":true}'{% } %}>
  140. <i class="glyphicon glyphicon-trash"></i>
  141. <span>Delete</span>
  142. </button>
  143. <input type="checkbox" name="delete" value="1" class="toggle">
  144. {% } else { %}
  145. <button class="btn btn-warning cancel">
  146. <i class="glyphicon glyphicon-ban-circle"></i>
  147. <span>Cancel</span>
  148. </button>
  149. {% } %}
  150. </td>
  151. </tr>
  152. {% } %}
  153. </script>
  154. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  155. <!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
  156. <script src="js/vendor/jquery.ui.widget.js"></script>
  157. <!-- The Templates plugin is included to render the upload/download listings -->
  158. <script src="//blueimp.github.io/JavaScript-Templates/js/tmpl.min.js"></script>
  159. <!-- The Load Image plugin is included for the preview images and image resizing functionality -->
  160. <script src="//blueimp.github.io/JavaScript-Load-Image/js/load-image.all.min.js"></script>
  161. <!-- The Canvas to Blob plugin is included for image resizing functionality -->
  162. <script src="//blueimp.github.io/JavaScript-Canvas-to-Blob/js/canvas-to-blob.min.js"></script>
  163. <!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
  164. <script src="//netdna.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
  165. <!-- blueimp Gallery script -->
  166. <script src="//blueimp.github.io/Gallery/js/jquery.blueimp-gallery.min.js"></script>
  167. <!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
  168. <script src="js/jquery.iframe-transport.js"></script>
  169. <!-- The basic File Upload plugin -->
  170. <script src="js/jquery.fileupload.js"></script>
  171. <!-- The File Upload processing plugin -->
  172. <script src="js/jquery.fileupload-process.js"></script>
  173. <!-- The File Upload image preview & resize plugin -->
  174. <script src="js/jquery.fileupload-image.js"></script>
  175. <!-- The File Upload audio preview plugin -->
  176. <script src="js/jquery.fileupload-audio.js"></script>
  177. <!-- The File Upload video preview plugin -->
  178. <script src="js/jquery.fileupload-video.js"></script>
  179. <!-- The File Upload validation plugin -->
  180. <script src="js/jquery.fileupload-validate.js"></script>
  181. <!-- The File Upload user interface plugin -->
  182. <script src="js/jquery.fileupload-ui.js"></script>
  183. <!-- The main application script -->
  184. <script src="js/main.js"></script>
  185. <!-- The XDomainRequest Transport is included for cross-domain file deletion for IE 8 and IE 9 -->
  186. <!--[if (gte IE 8)&(lt IE 10)]>
  187. <script src="js/cors/jquery.xdr-transport.js"></script>
  188. <![endif]-->
  189. </body>
  190. </html>