Method: files.copy
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
यह फ़ाइल की कॉपी बनाता है और पैच सिमैंटिक के साथ, अनुरोध किए गए अपडेट लागू करता है. ज़्यादा जानकारी के लिए, फ़ाइलें बनाना और मैनेज करना लेख पढ़ें.
एचटीटीपी अनुरोध
POST https://www.googleapis.com/drive/v3/files/{fileId}/copy
यह यूआरएल, gRPC ट्रांसकोडिंग सिंटैक्स का इस्तेमाल करता है.
पाथ पैरामीटर
पैरामीटर |
fileId |
string
फ़ाइल का आईडी.
|
क्वेरी पैरामीटर
पैरामीटर |
enforceSingleParent (deprecated) |
boolean
बंद कर दी गई सुविधा: फ़ाइलों को एक से ज़्यादा फ़ोल्डर में कॉपी करने की सुविधा अब काम नहीं करती. इसके बजाय, शॉर्टकट का इस्तेमाल करें.
|
ignoreDefaultVisibility |
boolean
क्या बनाई गई फ़ाइल के लिए, डोमेन की डिफ़ॉल्ट रूप से दिखने की सेटिंग को अनदेखा करना है. डोमेन एडमिन के पास यह विकल्प होता है कि वे अपलोड की गई सभी फ़ाइलों को डिफ़ॉल्ट रूप से डोमेन के लिए दिखने वाली फ़ाइलें बना दें. यह पैरामीटर, अनुरोध के लिए इस सेटिंग को बायपास करता है. अनुमतियां अब भी पैरंट फ़ोल्डर से इनहेरिट की जाती हैं.
|
keepRevisionForever |
boolean
नई हेडलाइन में keepForever फ़ील्ड सेट करना है या नहीं. यह सुविधा, Google Drive में मौजूद बाइनरी कॉन्टेंट वाली फ़ाइलों पर ही लागू होती है. किसी फ़ाइल के सिर्फ़ 200 वर्शन हमेशा के लिए सेव किए जा सकते हैं. अगर सीमा पूरी हो गई है, तो पिन किए गए वर्शन मिटाएं.
|
ocrLanguage |
string
इमेज इंपोर्ट करते समय, ओसीआर प्रोसेसिंग के लिए भाषा का हिंट (ISO 639-1 कोड).
|
supportsAllDrives |
boolean
अनुरोध करने वाला ऐप्लिकेशन, 'मेरी ड्राइव' और शेयर की गई ड्राइव, दोनों के साथ काम करता है या नहीं.
|
supportsTeamDrives (deprecated) |
boolean
इस्तेमाल बंद कर दिया गया है: इसके बजाय, supportsAllDrives का इस्तेमाल करें.
|
includePermissionsForView |
string
इससे यह तय होता है कि जवाब में किस अतिरिक्त व्यू की अनुमतियां शामिल करनी हैं. वैल्यू के तौर पर, सिर्फ़ published को इस्तेमाल किया जा सकता है.
|
includeLabels |
string
labelInfo के तौर पर जवाब में शामिल किए जाने वाले लेबल के आईडी की कॉमा लगाकर अलग की गई सूची.
|
अनुरोध का मुख्य भाग
अनुरोध के मुख्य भाग में File
का उदाहरण है.
जवाब का मुख्य भाग
कामयाब रहने पर, जवाब के मुख्य हिस्से में File
का एक इंस्टेंस शामिल किया जाता है.
अनुमति के स्कोप
इसके लिए, इनमें से किसी एक OAuth स्कोप की ज़रूरत होती है:
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.appdata
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.photos.readonly
कुछ स्कोप पर पाबंदी है. इसलिए, आपके ऐप्लिकेशन को इनका इस्तेमाल करने से पहले सुरक्षा का आकलन करना होगा. ज़्यादा जानकारी के लिए, अनुमति देने से जुड़ी गाइड देखें.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया."],[],[],null,["# Method: files.copy\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nCreates a copy of a file and applies any requested updates with patch semantics.\n\n### HTTP request\n\n`POST https://www.googleapis.com/drive/v3/files/{fileId}/copy`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|------------------------------|\n| `fileId` | `string` The ID of the file. |\n\n### Query parameters\n\n| Parameters ||\n|---------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `enforceSingleParent` | `boolean` Deprecated. Copying files into multiple folders is no longer supported. Use shortcuts instead. |\n| `ignoreDefaultVisibility` | `boolean` Whether to ignore the domain's default visibility settings for the created file. Domain administrators can choose to make all uploaded files visible to the domain by default; this parameter bypasses that behavior for the request. Permissions are still inherited from parent folders. |\n| `keepRevisionForever` | `boolean` Whether to set the 'keepForever' field in the new head revision. This is only applicable to files with binary content in Google Drive. Only 200 revisions for the file can be kept forever. If the limit is reached, try deleting pinned revisions. |\n| `ocrLanguage` | `string` A language hint for OCR processing during image import (ISO 639-1 code). |\n| `supportsAllDrives` | `boolean` Whether the requesting application supports both My Drives and shared drives. |\n| `supportsTeamDrives` **(deprecated)** | `boolean` Deprecated: Use `supportsAllDrives` instead. |\n| `includePermissionsForView` | `string` Specifies which additional view's permissions to include in the response. Only 'published' is supported. |\n| `includeLabels` | `string` A comma-separated list of IDs of labels to include in the `labelInfo` part of the response. |\n\n### Request body\n\nThe request body contains an instance of [File](/workspace/drive/api/reference/rest/v3/files#File).\n\n### Response body\n\nIf successful, the response body contains an instance of [File](/workspace/drive/api/reference/rest/v3/files#File).\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://www.googleapis.com/auth/drive`\n- `\n https://www.googleapis.com/auth/drive.appdata`\n- `\n https://www.googleapis.com/auth/drive.file`\n- `\n https://www.googleapis.com/auth/drive.photos.readonly`\n\nSome scopes are restricted and require a security assessment for your app to use them. For more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]