تتضمّن قائمة التحكم بالوصول (ACL) الخاصة بالاختصار قائمة التحكم بالوصول الخاصة بالعنصر الرئيسي. لا يمكن تغيير قائمة التحكّم بالوصول (ACL) الخاصة بالاختصار مباشرةً.
targetId يشير إلى الملف أو المجلد المستهدَف، ويُعرف أيضًا باسم "الهدف".
targetMimeType يشير إلى نوع MIME الخاص بالهدف. تُستخدَم السمة
targetMimeType لتحديد رمز النوع الذي سيتم عرضه. يتم نسخ نوع MIME الخاص بالعنصر المستهدف إلى الحقل targetMimeType عند إنشاء الاختصار.
الحقلان targetId وtargetMimeType هما جزء من الحقل shortcutDetails
ضمن مورد الملف.
لا يمكن أن يكون للاختصار سوى عنصر رئيسي واحد. إذا كان ملف الاختصار مطلوبًا في مواقع أخرى على Drive، يمكن نسخ ملف الاختصار إلى المواقع الإضافية.
عند حذف المستند الهدف أو عندما يفقد المستخدم الحالي إذن الوصول إلى المستند الهدف، سيتعطّل الاختصار الذي يشير إلى المستند الهدف.
يمكن أن يختلف عنوان الاختصار عن عنوان الهدف. عند إنشاء اختصار، يتم استخدام عنوان العنصر المستهدف كعنوان للاختصار. بعد إنشاء الاختصار، يمكن تغيير عنوانه وعنوان العنصر المستهدَف بشكل مستقل. إذا تم تغيير اسم الهدف، ستحتفظ الاختصارات التي تم إنشاؤها سابقًا بالعنوان القديم.
قد يصبح نوع MIME الخاص بالاختصار قديمًا. على الرغم من أنّ ذلك نادر الحدوث، يتغيّر نوع MIME لملف blob عند تحميل نسخة معدَّلة من نوع مختلف، ولكن تحتفظ أي اختصارات تشير إلى الملف المعدَّل بنوع MIME الأصلي. على سبيل المثال، إذا حمّلت ملف JPG إلى Drive، ثم حمّلت نسخة AVI معدَّلة، سيتعرّف Drive على التغيير ويعدّل الصورة المصغّرة للملف الفعلي. ومع ذلك، يظل الاختصار يتضمّن صورة مصغّرة بتنسيق JPG.
في تصدير بيانات حساب Google المعروف أيضًا باسم Google Takeout، يتم تمثيل الاختصارات كملفات إشارات مرجعية في Netscape تحتوي على روابط تؤدي إلى الهدف.
لإنشاء اختصار، اضبط نوع MIME على
application/vnd.google-apps.shortcut، واضبط targetId على الملف أو المجلد
الذي يجب أن يرتبط به الاختصار، ثم استدعِ files.create لإنشاء اختصار.
توضّح الأمثلة التالية كيفية إنشاء اختصار باستخدام مكتبة برامج:
يتم إنشاء الاختصار تلقائيًا في "ملفاتي" الخاصة بالمستخدم الحالي، ولا يتم إنشاء الاختصارات إلا للملفات أو المجلدات التي يمكن للمستخدم الحالي الوصول إليها.
البحث عن اختصار
للبحث عن اختصار، استخدِم سلسلة طلب البحث q مع
files.list لفلترة الاختصارات التي تريد عرضها.
mimeType operator values
المكان:
query_term هي عبارة البحث أو الحقل المطلوب البحث فيه. للاطّلاع على عبارات البحث التي يمكن استخدامها لفلترة مساحات التخزين السحابي المشتركة، يُرجى الرجوع إلى عبارات البحث.
تحدّد operator شرط عبارة البحث. للاطّلاع على عوامل التشغيل التي يمكنك استخدامها مع كل عبارة بحث، يُرجى الرجوع إلى عوامل تشغيل البحث.
القيم هي القيم المحدّدة التي تريد استخدامها لفلترة نتائج البحث.
على سبيل المثال، تعمل سلسلة طلب البحث التالية على فلترة البحث لعرض جميع اختصارات ملفات جداول البيانات:
تاريخ التعديل الأخير: 2025-08-29 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-08-29 (حسب التوقيت العالمي المتفَّق عليه)"],[],[],null,["# Create a shortcut to a Drive file\n\n*Shortcuts* are files that link to other files or folders on Google Drive.\nShortcuts have these characteristics:\n\n- An `application/vnd.google-apps.shortcut` MIME type. For more information,\n see [Google Workspace \\& Google Drive supported MIME\n types](/workspace/drive/api/guides/mime-types).\n\n- The ACL for a shortcut inherits the ACL of the parent. The shortcut's ACL\n cannot be changed directly.\n\n- A `targetId` pointing to the target file or folder, also referred to as the\n \"target.\"\n\n- A `targetMimeType` indicating the MIME type for the target. The\n `targetMimeType` is used to determine the type icon to display. The target's\n MIME type is copied to the `targetMimeType` field when the shortcut is\n created.\n\n- The `targetId` and `targetMimeType` fields are part of the `shortcutDetails`\n field within the [file](/workspace/drive/api/reference/rest/v3/files) resource.\n\n- A shortcut can only have one parent. If a shortcut file is required in other\n Drive locations, the shortcut file can be copied to the\n additional locations.\n\n- When the target is deleted, or when the current user loses access to the\n target, the user's shortcut pointing to the target breaks.\n\n- The title of a shortcut can differ from the target. When a shortcut is\n created, the title of the target is used as the title of the shortcut. After\n creation, the shortcut's title and target's title can be changed\n independently. If the target's name is changed, previously created shortcuts\n retain the old title.\n\n- The MIME type of a shortcut can become stale. While rare, a blob file's MIME\n type changes when a revision of a different type is uploaded, but any\n shortcuts pointing to the updated file retain the original MIME type. For\n example, if you upload a JPG file to Drive, then upload an\n AVI revision, Drive identifies the change and updates the\n thumbnail for the actual file. However, the shortcut continues to have a JPG\n thumbnail.\n\n- In [Google Account Data\n Export](https://support.google.com/accounts/answer/3024190)\n also known as Google Takeout, shortcuts are represented as Netscape\n bookmark files containing links to the target.\n\nFor more information, see [Find files \\& folders with Google Drive\nshortcuts](https://support.google.com/drive/answer/9700156)\n.\n| **Important:** Previously, shortcuts were the term for files that pointed to content stored by an application. That type of \"shortcut\" was renamed to *third-party shortcut* . For further information, see [Create a shortcut file to\n| content stored by your app](/workspace/drive/api/guides/third-party-shortcuts).\n\nCreate a shortcut\n-----------------\n\nTo create a shortcut, set the MIME type to\n`application/vnd.google-apps.shortcut`, set the `targetId` to the file or folder\nthe shortcut should link to, and call [`files.create`](/workspace/drive/api/reference/rest/v3/files/create) to create a shortcut.\n| **Note:** If you're using V2 of the API, use [`files.insert`](/workspace/drive/api/v2/reference/files/insert).\n\nThe following examples show how to create a shortcut using a client library: \n\n### Python\n\n file_metadata = {\n 'name': '\u003cvar translate=\"no\"\u003eFILE_NAME\u003c/var\u003e',\n 'mimeType': 'text/plain'\n }\n file = drive_service.files().create(body=file_metadata, fields='id').execute()\n print('File ID: %s' % file.get('id'))\n shortcut_metadata = {\n 'Name': '\u003cvar translate=\"no\"\u003eSHORTCUT_NAME\u003c/var\u003e',\n 'mimeType': 'application/vnd.google-apps.shortcut',\n 'shortcutDetails': {\n 'targetId': file.get('id')\n }\n }\n shortcut = drive_service.files().create(body=shortcut_metadata,\n fields='id,shortcutDetails').execute()\n print('File ID: %s, Shortcut Target ID: %s, Shortcut Target MIME type: %s' % (\n shortcut.get('id'),\n shortcut.get('shortcutDetails').get('targetId'),\n shortcut.get('shortcutDetails').get('targetMimeType')))\n\n### Node.js\n\n var fileMetadata = {\n 'name': '\u003cvar translate=\"no\"\u003eFILE_NAME\u003c/var\u003e',\n 'mimeType': 'text/plain'\n };\n drive.files.create({\n 'resource': fileMetadata,\n 'fields': 'id'\n }, function (err, file) {\n if (err) {\n // Handle error\n console.error(err);\n } else {\n console.log('File Id: ' + file.id);\n shortcutMetadata = {\n 'name': '\u003cvar translate=\"no\"\u003eSHORTCUT_NAME\u003c/var\u003e',\n 'mimeType': 'application/vnd.google-apps.shortcut'\n 'shortcutDetails': {\n 'targetId': file.id\n }\n };\n drive.files.create({\n 'resource': shortcutMetadata,\n 'fields': 'id,name,mimeType,shortcutDetails'\n }, function(err, shortcut) {\n if (err) {\n // Handle error\n console.error(err);\n } else {\n console.log('Shortcut Id: ' + shortcut.id +\n ', Name: ' + shortcut.name +\n ', target Id: ' + shortcut.shortcutDetails.targetId +\n ', target MIME type: ' + shortcut.shortcutDetails.targetMimeType);\n }\n }\n }\n });\n\nReplace the following:\n\n- \u003cvar translate=\"no\"\u003eFILE_NAME\u003c/var\u003e: the file name requiring a shortcut.\n- \u003cvar translate=\"no\"\u003eSHORTCUT_NAME\u003c/var\u003e: the name for this shortcut.\n\nBy default, the shortcut is created on the current user's My\nDrive and shortcuts are only created for files or folders for\nwhich the current user has access.\n\nSearch for a shortcut\n---------------------\n\nTo search for a shortcut, use the query string `q` with\n[`files.list`](/workspace/drive/api/v3/reference/files/list) to filter the shortcuts to\nreturn.\n\n`mimeType `*operator values*\n\nWhere:\n\n- *query_term* is the query term or field to search upon. To view the query terms that can be used to filter shared drives, refer to [Search query\n terms](/workspace/drive/api/guides/ref-search-terms#file_properties).\n- *operator* specifies the condition for the query term. To view which operators you can use with each query term, refer to [Query operators](/workspace/drive/api/guides/ref-search-terms#operators).\n- *values* are the specific values you want to use to filter your search results.\n\nFor example, the following query string filters the search to return all\nshortcuts to spreadsheet files: \n\n q: mimeType='application/vnd.google-apps.shortcut' AND shortcutDetails.targetMimeType='application/vnd.google-apps.spreadsheet'"]]