forked from blueimp/jQuery-File-Upload
- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic.html
More file actions
Latest commit
135 lines (135 loc) · 6.57 KB
/
Copy pathbasic.html
File metadata and controls
135 lines (135 loc) · 6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin Basic Demo 1.0
* https://github.com/blueimp/jQuery-File-Upload
*
* Copyright 2013, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* http://www.opensource.org/licenses/MIT
*/
-->
<htmllang="en">
<head>
<!-- Force latest IE rendering engine or ChromeFrame if installed -->
<!--[if IE]><meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"><![endif]-->
<metacharset="utf-8">
<title>jQuery File Upload Demo - Basic version</title>
<metaname="description" content="File Upload widget with multiple file selection, drag&drop support and progress bar for jQuery. Supports cross-domain, chunked and resumable file uploads. Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.">
<metaname="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap CSS Toolkit styles -->
<linkrel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap.min.css">
<!-- Generic page styles -->
<linkrel="stylesheet" href="css/style.css">
<!-- Bootstrap styles for responsive website layout, supporting different screen sizes -->
<linkrel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-responsive.min.css">
<!-- Bootstrap CSS fixes for IE6 -->
<!--[if lt IE 7]><link rel="stylesheet" href="http://blueimp.github.com/cdn/css/bootstrap-ie6.min.css"><![endif]-->
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<linkrel="stylesheet" href="css/jquery.fileupload-ui.css">
</head>
<body>
<divclass="navbar navbar-fixed-top">
<divclass="navbar-inner">
<divclass="container">
<aclass="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<spanclass="icon-bar"></span>
<spanclass="icon-bar"></span>
<spanclass="icon-bar"></span>
</a>
<aclass="brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
<divclass="nav-collapse">
<ulclass="nav">
<liclass="active"><ahref="http://blueimp.github.com/jQuery-File-Upload/">Demo</a></li>
<li><ahref="https://github.com/blueimp/jQuery-File-Upload#download">Download</a></li>
<li><ahref="https://github.com/blueimp/jQuery-File-Upload">Source Code</a></li>
<li><ahref="https://github.com/blueimp/jQuery-File-Upload/wiki">Documentation</a></li>
<li><ahref="https://github.com/blueimp/jQuery-File-Upload#support">Support</a></li>
<li><ahref="https://blueimp.net">© Sebastian Tschan</a></li>
</ul>
</div>
</div>
</div>
</div>
<divclass="container">
<divclass="page-header">
<h1>jQuery File Upload Demo</h1>
<h2class="lead">Basic version</h2>
<ulclass="nav nav-tabs">
<liclass="active"><ahref="basic.html">Basic</a></li>
<li><ahref="basic-plus.html">Basic Plus</a></li>
<li><ahref="index.html">Basic Plus UI</a></li>
<li><ahref="angularjs.html">AngularJS</a></li>
</ul>
<blockquote>
<p>File Upload widget with multiple file selection, drag&drop support and progress bar for jQuery.<br>
Supports cross-domain, chunked and resumable file uploads.<br>
Works with any server-side platform (PHP, Python, Ruby on Rails, Java, Node.js, Go etc.) that supports standard HTML form file uploads.</p>
</blockquote>
</div>
<!-- The fileinput-button span is used to style the file input field as button -->
<spanclass="btn btn-success fileinput-button">
<iclass="icon-plus icon-white"></i>
<span>Select files...</span>
<!-- The file input field used as target for the file upload widget -->
<inputid="fileupload" type="file" name="files[]" multiple>
</span>
<br>
<br>
<!-- The global progress bar -->
<divid="progress" class="progress progress-success progress-striped">
<divclass="bar"></div>
</div>
<!-- The container for the uploaded files -->
<divid="files" class="files"></div>
<br>
<divclass="well">
<h3>Demo Notes</h3>
<ul>
<li>The maximum file size for uploads in this demo is <strong>5 MB</strong> (default file size is unlimited).</li>
<li>Only image files (<strong>JPG, GIF, PNG</strong>) are allowed in this demo (by default there is no file type restriction).</li>
<li>Uploaded files will be deleted automatically after <strong>5 minutes</strong> (demo setting).</li>
<li>You can <strong>drag & drop</strong> files from your desktop on this webpage with Google Chrome, Mozilla Firefox and Apple Safari.</li>
<li>Please refer to the <ahref="https://github.com/blueimp/jQuery-File-Upload">project website</a> and <ahref="https://github.com/blueimp/jQuery-File-Upload/wiki">documentation</a> for more information.</li>
<li>Built with Twitter's <ahref="http://twitter.github.com/bootstrap/">Bootstrap</a> toolkit and Icons from <ahref="http://glyphicons.com/">Glyphicons</a>.</li>
</ul>
</div>
</div>
<scriptsrc="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- The jQuery UI widget factory, can be omitted if jQuery UI is already included -->
<scriptsrc="js/vendor/jquery.ui.widget.js"></script>
<!-- The Iframe Transport is required for browsers without support for XHR file uploads -->
<scriptsrc="js/jquery.iframe-transport.js"></script>
<!-- The basic File Upload plugin -->
<scriptsrc="js/jquery.fileupload.js"></script>
<script>
/*jslint unparam: true */
/*global window, $ */
$(function(){
'use strict';
// Change this to the location of your server-side upload handler:
varurl=(window.location.hostname==='blueimp.github.com'||
window.location.hostname==='blueimp.github.io') ?
'//jquery-file-upload.appspot.com/' : 'server/php/';
$('#fileupload').fileupload({
url: url,
dataType: 'json',
done: function(e,data){
$.each(data.result.files,function(index,file){
$('<p/>').text(file.name).appendTo('#files');
});
},
progressall: function(e,data){
varprogress=parseInt(data.loaded/data.total*100,10);
$('#progress .bar').css(
'width',
progress+'%'
);
}
});
});
</script>
</body>
</html>