我已经设置了一个 Google Docs Picker 以允许用户从 Google Drive 中选择图像或上传它们。
加载选择器后,网格视图中的某些图像预览不会加载。这似乎是随机的,错误是 404(未找到)。为https://googledrive.com/thumb/fileId?access_token=ya....&size=180格式的 url 返回 404
这是我可以在我的 JavaScript 代码中解决的问题吗?请参阅下面的代码。
var driveView = new google.picker.DocsView(google.picker.ViewId.DOCS_IMAGES);
driveView.setParent(driveFolderId); //sets the default displayed folder
var uploadView = new google.picker.DocsUploadView();
uploadView.setParent(driveFolderId); //set upload parent folder and prevents the user from changing it
uploadView.setMimeTypes('image/png,image/jpeg'); //image/bmp,image/gif,image/tiff
//default file type to png and jpeg
var picker = new google.picker.PickerBuilder()
//.enableFeature(google.picker.Feature.NAV_HIDDEN) //hide navigation
.enableFeature(google.picker.Feature.MULTISELECT_ENABLED) // multi select - bug must be enabled to set the upload folder destination
.addView(driveView) //allows picking files from Google Drive
.addView(uploadView) //allows uploads
.setOAuthToken(gapi.auth.getToken().access_token)
.setCallback(imagePickerCallback)
.build();
picker.setVisible(true);
提前致谢。