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
136 lines (136 loc) · 6.51 KB
/
Copy pathbasic.html
File metadata and controls
136 lines (136 loc) · 6.51 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
136
<!DOCTYPE HTML>
<!--
/*
* jQuery File Upload Plugin Basic Demo 1.2.4
* 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 styles -->
<linkrel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<!-- Generic page styles -->
<linkrel="stylesheet" href="css/style.css">
<!-- CSS to style the file input field as button and adjust the Bootstrap progress bars -->
<linkrel="stylesheet" href="css/jquery.fileupload.css">
</head>
<body>
<divclass="navbar navbar-default navbar-fixed-top">
<divclass="container">
<divclass="navbar-header">
<buttontype="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-fixed-top .navbar-collapse">
<spanclass="icon-bar"></span>
<spanclass="icon-bar"></span>
<spanclass="icon-bar"></span>
</button>
<aclass="navbar-brand" href="https://github.com/blueimp/jQuery-File-Upload">jQuery File Upload</a>
</div>
<divclass="navbar-collapse collapse">
<ulclass="nav navbar-nav">
<li><ahref="https://github.com/blueimp/jQuery-File-Upload/tags">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://blueimp.net">© Sebastian Tschan</a></li>
</ul>
</div>
</div>
</div>
<divclass="container">
<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>
<li><ahref="jquery-ui.html">jQuery UI</a></li>
</ul>
<br>
<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>
<br>
<!-- The fileinput-button span is used to style the file input field as button -->
<spanclass="btn btn-success fileinput-button">
<iclass="glyphicon glyphicon-plus"></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">
<divclass="progress-bar progress-bar-success"></div>
</div>
<!-- The container for the uploaded files -->
<divid="files" class="files"></div>
<br>
<divclass="panel panel-default">
<divclass="panel-heading">
<h3class="panel-title">Demo Notes</h3>
</div>
<divclass="panel-body">
<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 (see <ahref="https://github.com/blueimp/jQuery-File-Upload/wiki/Browser-support">Browser support</a>).</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> CSS framework and Icons from <ahref="http://glyphicons.com/">Glyphicons</a>.</li>
</ul>
</div>
</div>
</div>
<scriptsrc="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/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>
<!-- Bootstrap JS is not required, but included for the responsive demo navigation -->
<scriptsrc="//netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.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.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 .progress-bar').css(
'width',
progress+'%'
);
}
}).prop('disabled',!$.support.fileInput)
.parent().addClass($.support.fileInput ? undefined : 'disabled');
});
</script>
</body>
</html>