نمونه های Google Drive API
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
این بخش نمونه هایی را برای Google Drive API ارائه می دهد.
برای ویدیوهای مقدماتی درباره Drive API، به کتابخانه ویدیوی Drive API مراجعه کنید.
گوگل نمونه های زیر را در GitHub میزبانی می کند. شما می توانید این مخازن را فورک کنید و از کد به عنوان مرجع برای پروژه های خود استفاده کنید.
Google Picker
نمونه کد Google Picker نحوه استفاده از یک انتخابگر تصویر یا صفحه آپلود را نشان می دهد که کاربران می توانند از دکمه ای در یک برنامه وب باز کنند.
برای مشاهده یا دانلود منبع، به Google Picker در مخزن GitHub مراجعه کنید.
فایل ها را با Quickeditors باز کرده و ذخیره کنید
این نمونه کد Quickeditors نحوه باز کردن و ذخیره فایلها با Drive API را نشان میدهد.
هر یک از نمونههای مخصوص پلتفرم Drive یک برنامه نمونه منعکس میکند: یک ویرایشگر متن، به نام Quickeditor، که قادر به ویرایش فایلهای Drive با نوع MIME text/*
است. نسخه وب دو مورد اساسی استفاده از Drive را پیاده سازی می کند:
جریان برای هر دو مورد استفاده مشابه است. پس از اینکه کاربر آن را از منوی ایجاد یا منوی زمینه یک فایل با نوع MIME ثبت شده انتخاب کرد، Drive کاربر را به برنامه هدایت می کند.
برای مشاهده یا دانلود منبع، از Drive Quickeditors در مخزن GitHub دیدن کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-08-29 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Google Drive API samples\n\nThis section provides samples for Google Drive API.\n\nFor introductory videos about Drive API, see the [Drive API\nvideo library](/workspace/drive/api/guides/videos).\n\nGoogle hosts the following samples on GitHub. You can fork these repositories\nand use the code as a reference for your own projects.\n\nGoogle Picker\n-------------\n\nThe [Google Picker code sample](/workspace/drive/picker/guides/sample) shows how to use\nan image selector or upload page that users can open from a button in a web app.\n\nTo view or download the source, visit\n[Google Picker](https://github.com/googleworkspace/browser-samples/tree/main/drive/picker)\non the GitHub repository.\n\nOpen and save files with Quickeditors\n-------------------------------------\n\nThis Quickeditors code sample shows how to open and save files with the\nDrive API.\n\nEach of the Drive platform-specific examples reflects a single\nsample app: a text editor, called a Quickeditor, capable of editing\nDrive files with the MIME type `text/*`. The [web\nversion](https://github.com/googleworkspace/drive-quickeditors/tree/main/web)\nimplements two fundamental Drive use cases:\n\n- [Integrate with Drive UI's \"New\" button](/workspace/drive/api/guides/integrate-create)\n- [Integrate with Drive UI's \"Open with\" context menu](/workspace/drive/api/guides/integrate-open)\n\nThe flow for both use cases is similar. Drive redirects a user to\nthe app after the user selects it from the create menu or the context menu of a\nfile with a registered [MIME type](/workspace/drive/api/guides/mime-types).\n\nTo view or download the source, visit [Drive\nQuickeditors](https://github.com/googledrive/web-quickeditor) on the GitHub\nrepository.\n\nRelated topics\n--------------\n\n- [The Google Picker API](/workspace/drive/picker/guides/overview)\n- [Drive UI integration overview](/workspace/drive/api/guides/about-apps)"]]