Metode PickerBuilder.setSelectableMimeTypes
Tetapkan daftar jenis MIME yang akan dapat dipilih. Gunakan koma untuk memisahkan
jenis MIME jika lebih dari satu diperlukan. Jika Anda tidak menetapkan jenis MIME, file dari
semua jenis MIME akan ditampilkan dalam tampilan.
Contoh
Penggunaan dasar dengan beberapa jenis MIME
const mimeTypes = ['image/png', 'image/jpeg'];
const builder = new google.pickerPickerBuilder()
.setSelectableMimeTypes(mimeTypes.join(','));
Jenis MIME Google Workspace
const mimeTypes = [
'application/vnd.google-apps.document',
'application/vnd.google-apps.presentation',
'application/vnd.google-apps.spreadsheet',
];
const builder = new google.pickerPickerBuilder()
.setSelectableMimeTypes(mimeTypes.join(','));
Tanda Tangan
setSelectableMimeTypes(type: string): PickerBuilder;
Detail
Opsional |
Tidak |
Final |
Tidak |
Dengan kontrasepsi |
Tidak |
Statis |
Tidak |
Parameter
Nama |
Jenis |
Opsional |
Deskripsi |
type |
string |
Tidak |
|
Hasil
PickerBuilder
Kecuali dinyatakan lain, konten di halaman ini dilisensikan berdasarkan Lisensi Creative Commons Attribution 4.0, sedangkan contoh kode dilisensikan berdasarkan Lisensi Apache 2.0. Untuk mengetahui informasi selengkapnya, lihat Kebijakan Situs Google Developers. Java adalah merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2024-10-15 UTC.
[null,null,["Terakhir diperbarui pada 2024-10-15 UTC."],[[["Defines the accepted file types for display in the Google Picker view."],["Uses a comma-separated string of MIME types to specify allowed file formats."],["If no MIME types are set, all file types will be visible."],["Provides examples for basic usage and Google Workspace specific MIME types."],["Returns a PickerBuilder object for chaining further configurations."]]],["The `setSelectableMimeTypes` method, part of `PickerBuilder`, filters selectable file types. It takes a comma-separated string of MIME types as input. If no MIME types are specified, all file types are selectable. Examples show usage with image types and Google Workspace types. This method, which is not optional, final, protected or static, returns a `PickerBuilder` object, and it is necessary to input a string value.\n"]]