Method: children.insert
یک فایل را در یک پوشه وارد می کند.
درخواست HTTP
POST https://www.googleapis.com/drive/v2/files/{folderId}/children
URL از دستور GRPC Transcoding استفاده می کند.
پارامترهای مسیر
مولفه های |
---|
folderId | string شناسه پوشه |
پارامترهای پرس و جو
مولفه های |
---|
enforceSingleParent (deprecated) | boolean منسوخ شده: افزودن فایل به چند پوشه دیگر پشتیبانی نمی شود. به جای آن shortcuts استفاده کنید. |
supportsAllDrives | boolean اینکه آیا برنامه درخواست کننده هم از My Drives و هم درایوهای مشترک پشتیبانی می کند. |
supportsTeamDrives (deprecated) | boolean منسوخ شده: به جای آن از supportsAllDrives استفاده کنید. |
درخواست بدن
بدنه درخواست شامل یک نمونه از ChildReference
است.
بدن پاسخگو
در صورت موفقیت آمیز بودن، بدنه پاسخ حاوی یک نمونه تازه ایجاد شده از ChildReference
است.
محدوده مجوز
به یکی از حوزه های OAuth زیر نیاز دارد:
-
https://www.googleapis.com/auth/docs
-
https://www.googleapis.com/auth/drive
-
https://www.googleapis.com/auth/drive.appdata
-
https://www.googleapis.com/auth/drive.file
برخی از دامنه ها محدود هستند و برای استفاده از برنامه شما به ارزیابی امنیتی نیاز دارند. برای اطلاعات بیشتر، به راهنمای مجوز مراجعه کنید.
جز در مواردی که غیر از این ذکر شده باشد،محتوای این صفحه تحت مجوز Creative Commons Attribution 4.0 License است. نمونه کدها نیز دارای مجوز Apache 2.0 License است. برای اطلاع از جزئیات، به خطمشیهای سایت Google Developers مراجعه کنید. جاوا علامت تجاری ثبتشده Oracle و/یا شرکتهای وابسته به آن است.
تاریخ آخرین بهروزرسانی 2024-10-30 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2024-10-30 بهوقت ساعت هماهنگ جهانی."],[[["This endpoint inserts a file into a specified folder within Google Drive using an HTTP POST request."],["The request requires a `folderId` path parameter to identify the target folder and accepts optional query parameters like `supportsAllDrives`."],["A `ChildReference` object is provided in the request body to specify the file to be inserted, and a newly created `ChildReference` is returned in the response upon success."],["Authorization is required with one of the listed OAuth scopes, such as `https://www.googleapis.com/auth/drive` or `https://www.googleapis.com/auth/drive.file`."]]],["The core action is inserting a file into a folder using a POST request to `https://www.googleapis.com/drive/v2/files/{folderId}/children`. The `folderId` is a required path parameter. Query parameters include `enforceSingleParent`, `supportsAllDrives`, and `supportsTeamDrives` with the latter two replacing the former. The request and response bodies use the `ChildReference` instance. Authorization requires specific OAuth scopes like `https://www.googleapis.com/auth/drive` and others, with some requiring security assessments.\n"]]