Yöntem PickerBuilder.setSelectableMimeTypes
Seçilebilir MIME türlerinin listesini ayarlayın. Ayırmak için virgül kullanın
Birden fazla MIME türleri. MIME türlerini ayarlamazsanız görünümde tüm MIME türlerine ait dosyalar gösterilir.
Örnekler
Birden çok MIME türüyle temel kullanım
const mimeTypes = ['image/png', 'image/jpeg'];
const builder = new google.pickerPickerBuilder()
.setSelectableMimeTypes(mimeTypes.join(','));
Google Workspace MIME türleri
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(','));
İmza
setSelectableMimeTypes(type: string): PickerBuilder;
Ayrıntılar
İsteğe bağlı |
Hayır |
Final |
Hayır |
Korumalı |
Hayır |
Statik |
Hayır |
Parametreler
Ad |
Tür |
İsteğe bağlı |
Açıklama |
type |
string |
Hayır |
|
İadeler
PickerBuilder
Aksi belirtilmediği sürece bu sayfanın içeriği Creative Commons Atıf 4.0 Lisansı altında ve kod örnekleri Apache 2.0 Lisansı altında lisanslanmıştır. Ayrıntılı bilgi için Google Developers Site Politikaları'na göz atın. Java, Oracle ve/veya satış ortaklarının tescilli ticari markasıdır.
Son güncelleme tarihi: 2024-10-15 UTC.
[null,null,["Son güncelleme tarihi: 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"]]