@@ -36,15 +36,16 @@ <h3 class="text-muted">Bootstrap File Filed</h3>
36
36
</ div >
37
37
38
38
< div class ="col-md-12 ">
39
- < h3 > Bootstrap File Field samples </ h3 >
39
+ < h3 > Bootstrap File Field demo </ h3 >
40
40
41
41
< p class ="lead ">
42
- This page has examples of various ways of using and configuring this plugin .
42
+ Examples of using and configuring < i > Bootstrap File Field </ i > in various ways .
43
43
</ p >
44
- < p class ="text-info "> < strong > Note:</ strong > On server end, you'll get the files as generic form submission process.</ p >
44
+ < p class ="text-info "> < strong > Note:</ strong > On server end, you'll receive the files with submitted form (with < code > enctype="multipart/form-data"</ code > ).
45
+ No ajax upload is being used.</ p >
45
46
< hr >
46
47
47
- < form role ="form " enctype ="application/x-www- form-urlencoded ">
48
+ < form role ="form " enctype ="multipart/ form-data ">
48
49
49
50
<!--<div class="form-group">-->
50
51
<!--<label for="photo" class="col-sm-3 control-label">Upload photos</label>-->
@@ -56,30 +57,68 @@ <h3>Bootstrap File Field samples</h3>
56
57
<!--<ul class="list-unstyled fileList"></ul>-->
57
58
<!--</div>-->
58
59
<!--</div>-->
60
+
59
61
< div class ="form-group ">
60
- < label for ="sample1 "> Initiate with data attribute, no customization</ label >
62
+ < label for ="sample1 "> Example 1: Initiating with data attribute, no customization</ label >
61
63
< p >
62
64
< code > <input type="file" data-field-type="bootstrap-file-filed" name="sample1"></ code >
63
65
</ p >
64
66
< input type ="file " data-field-type ="bootstrap-file-filed " name ="sample1 ">
65
67
</ div >
68
+
66
69
< div class ="form-group ">
67
- < label for ="sample2 "> Initiate with data attribute, with image thumb, custom label, button class and file types .</ label >
70
+ < label for ="sample2 "> Example 2: Single Image file with preview .</ label >
68
71
< p >
69
72
< code > <input type="file" name="sample2" data-field-type="bootstrap-file-filed" < br />
73
+ data-preview="on" < br />
74
+ data-file-types="image/jpeg,image/png,image/gif"></ code >
75
+ </ p >
76
+ < input type ="file " name ="sample2 "
77
+ data-field-type ="bootstrap-file-filed "
78
+ data-file-types ="image/jpeg,image/png,image/gif "
79
+ data-preview ="on ">
80
+ </ div >
81
+
82
+ < div class ="form-group ">
83
+ < label for ="sample3 "> Example 3: Showing image preview, setting custom label, class and file types. Allows multiple.</ label >
84
+ < p >
85
+ < code > <input type="file" name="sample3[]" data-field-type="bootstrap-file-filed" < br />
70
86
data-label="Select Image Files" < br />
71
87
data-btn-class="btn-primary" < br />
72
- data-file-types="image/jpeg,image/png"></ code >
88
+ data-file-types="image/jpeg,image/png,image/gif" < br />
89
+ data-preview="on" < br />
90
+ multiple >
91
+ </ code >
73
92
</ p >
74
- < input type ="file " name ="sample2 "
93
+ < input type ="file " name ="sample3[] "
75
94
data-field-type ="bootstrap-file-filed "
76
95
data-label ="Select Image Files "
77
96
data-btn-class ="btn-primary "
78
- data-file-types ="image/jpeg,image/png "
79
- data-preview ="off ">
97
+ data-file-types ="image/jpeg,image/png,image/gif "
98
+ data-preview ="on "
99
+ multiple
100
+ >
80
101
</ div >
102
+
81
103
< div class ="form-group ">
82
- < label for ="sample3 "> Initiate with javascript by class/selector.</ label >
104
+ < label for ="sample4 "> Example 4: Allow PDF files only. Preview off.</ label >
105
+ < p >
106
+ < code > <input type="file" name="sample4[]" data-field-type="bootstrap-file-filed" < br />
107
+ data-label="Select PDF Files" < br />
108
+ data-file-types="application/pdf" < br />
109
+ multiple >
110
+ </ code >
111
+ </ p >
112
+ < input type ="file " name ="sample4[] "
113
+ data-field-type ="bootstrap-file-filed "
114
+ data-label ="Select PDF Files "
115
+ data-file-types ="application/pdf "
116
+ multiple
117
+ >
118
+ </ div >
119
+
120
+ < div class ="form-group ">
121
+ < label for ="sample5 "> Example 5: Initiating with javascript by class/selector. Select at most 2 images below 80kb each.</ label >
83
122
84
123
< p >
85
124
HTML : < br />
@@ -97,20 +136,20 @@ <h3>Bootstrap File Field samples</h3>
97
136
< input type ="file " name ="sample3[] " class ="smart-file " multiple >
98
137
</ div >
99
138
< div class ="form-group ">
100
- < label for ="sample4 " > Overwriting initial (by javascript) configuration using data attribute</ label >
139
+ < label for ="sample6 " > Example 6: Overwriting initial (by javascript) configuration using data attribute</ label >
101
140
< p >
102
- This field has already been initiated with previous field (as it has class < code > smart-file</ code > ).
141
+ This field has already been initiated with previous example (as it has class < code > smart-file</ code > ).
103
142
Now we'll add and modify some of customization options using data attributes.
104
143
</ p >
105
144
< p >
106
145
< code >
107
- <input type="file" name="sample4 []" class="smart-file" multiple < br />
146
+ <input type="file" name="sample6 []" class="smart-file" multiple < br />
108
147
data-label="Select PDF Documents" < br />
109
148
data-btn-class="btn-primary" < br />
110
149
data-file-types="application/pdf">
111
150
</ code >
112
151
</ p >
113
- < input type ="file " name ="sample4 [] " class ="smart-file " multiple
152
+ < input type ="file " name ="sample6 [] " class ="smart-file " multiple
114
153
data-label ="Select PDF Documents "
115
154
data-btn-class ="btn-primary "
116
155
data-file-types ="application/pdf ">
@@ -142,15 +181,18 @@ <h4>Configuration Options</h4>
142
181
< table class ="table table-bordered ">
143
182
< tr >
144
183
< th > What to configure</ th >
145
- < th > JS Settings Option </ th >
184
+ < th > JS Settings key </ th >
146
185
< th > Data attribute</ th >
147
186
< th > Default</ th >
148
187
</ tr >
149
188
< tr >
150
189
< td > Button label</ td >
151
190
< td > label</ td >
152
191
< td > data-label</ td >
153
- < td > Select File</ td >
192
+ < td >
193
+ Select File < br />
194
+ Select Files < sup > M</ sup >
195
+ </ td >
154
196
</ tr >
155
197
< tr >
156
198
< td > Button class</ td >
@@ -167,6 +209,12 @@ <h4>Configuration Options</h4>
167
209
< td > data-file-types</ td >
168
210
< td > < em > Ignored</ em > </ td >
169
211
</ tr >
212
+ < tr >
213
+ < td > Preview thumb</ td >
214
+ < td > preview</ td >
215
+ < td > data-preview</ td >
216
+ < td > off</ td >
217
+ </ tr >
170
218
< tr >
171
219
< td > Maximum file size (in byte)</ td >
172
220
< td > maxFileSize</ td >
@@ -198,7 +246,7 @@ <h4>Configuration Options</h4>
198
246
< td > < em > Ignored</ em > </ td >
199
247
</ tr >
200
248
</ table >
201
- < p > < sup > M</ sup > = For multiple file selection only </ p >
249
+ < p > < sup > M</ sup > = For multiple file < selection > </ selection > </ p >
202
250
</ div >
203
251
</ div >
204
252
0 commit comments