File tree 3 files changed +10
-0
lines changed
3 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -113,6 +113,8 @@ customRequest callback is passed an object with:
113
113
114
114
abort(file?: File) => void: abort the uploading file
115
115
116
+ showOpenFilePicker() => void: open file picker
117
+
116
118
## License
117
119
118
120
rc-upload is released under the MIT license.
Original file line number Diff line number Diff line change @@ -41,6 +41,10 @@ class AjaxUploader extends Component<UploadProps> {
41
41
this . reset ( ) ;
42
42
} ;
43
43
44
+ showOpenFilePicker = ( ) => {
45
+ this . fileInput ?. click ( ) ;
46
+ } ;
47
+
44
48
onClick = ( e : React . MouseEvent < HTMLDivElement > | React . KeyboardEvent < HTMLDivElement > ) => {
45
49
const el = this . fileInput ;
46
50
if ( ! el ) {
Original file line number Diff line number Diff line change @@ -29,6 +29,10 @@ class Upload extends Component<UploadProps> {
29
29
this . uploader . abort ( file ) ;
30
30
}
31
31
32
+ showOpenFilePicker ( ) {
33
+ this . uploader . showOpenFilePicker ( ) ;
34
+ }
35
+
32
36
saveUploader = ( node : AjaxUpload ) => {
33
37
this . uploader = node ;
34
38
} ;
You can’t perform that action at this time.
0 commit comments