Drive 파일 바로가기 만들기
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
바로가기는 Google Drive의 다른 파일 또는 폴더로 연결되는 파일입니다.
단축키에는 다음과 같은 특징이 있습니다.
application/vnd.google-apps.shortcut
MIME 유형입니다. 자세한 내용은 Google Workspace 및 Google Drive에서 지원되는 MIME 유형을 참고하세요.
바로가기의 ACL은 상위의 ACL을 상속합니다. 바로가기의 ACL은 직접 변경할 수 없습니다.
타겟 파일 또는 폴더를 가리키는 targetId
('타겟'이라고도 함)
타겟의 MIME 유형을 나타내는 targetMimeType
입니다. targetMimeType
는 표시할 유형 아이콘을 결정하는 데 사용됩니다. 바로가기가 생성되면 타겟의 MIME 유형이 targetMimeType
필드에 복사됩니다.
targetId
및 targetMimeType
필드는 파일 리소스 내의 shortcutDetails
필드의 일부입니다.
바로가기에는 상위 요소가 하나만 있을 수 있습니다. 다른 Drive 위치에 바로가기 파일이 필요한 경우 바로가기 파일을 추가 위치에 복사할 수 있습니다.
타겟이 삭제되거나 현재 사용자가 타겟에 대한 액세스 권한을 잃으면 타겟을 가리키는 사용자의 바로가기가 작동하지 않습니다.
바로가기의 제목은 타겟과 다를 수 있습니다. 바로가기를 만들면 대상의 제목이 바로가기의 제목으로 사용됩니다. 생성 후에는 바로가기의 제목과 타겟의 제목을 독립적으로 변경할 수 있습니다. 타겟의 이름이 변경되면 이전에 생성된 바로가기는 이전 제목을 유지합니다.
바로가기의 MIME 유형이 오래될 수 있습니다. 드물지만 다른 유형의 수정사항이 업로드되면 blob 파일의 MIME 유형이 변경되지만 업데이트된 파일을 가리키는 바로가기는 원래 MIME 유형을 유지합니다. 예를 들어 JPG 파일을 Drive에 업로드한 다음 AVI 버전을 업로드하면 Drive에서 변경사항을 식별하고 실제 파일의 썸네일을 업데이트합니다. 하지만 바로가기에는 JPG 썸네일이 계속 표시됩니다.
Google 테이크아웃이라고도 하는 Google 계정 데이터 내보내기에서 바로가기는 타겟으로 연결되는 링크가 포함된 Netscape 북마크 파일로 표시됩니다.
자세한 내용은 Google Drive 바로가기로 파일 및 폴더 찾기를 참고하세요.
바로가기 만들기
바로가기를 만들려면 MIME 유형을 application/vnd.google-apps.shortcut
로 설정하고, targetId
을 바로가기가 연결되어야 하는 파일 또는 폴더로 설정하고, files.create
를 호출하여 바로가기를 만듭니다.
다음 예에서는 클라이언트 라이브러리를 사용하여 바로가기를 만드는 방법을 보여줍니다.
Python
file_metadata = {
'name': 'FILE_NAME',
'mimeType': 'text/plain'
}
file = drive_service.files().create(body=file_metadata, fields='id').execute()
print('File ID: %s' % file.get('id'))
shortcut_metadata = {
'Name': 'SHORTCUT_NAME',
'mimeType': 'application/vnd.google-apps.shortcut',
'shortcutDetails': {
'targetId': file.get('id')
}
}
shortcut = drive_service.files().create(body=shortcut_metadata,
fields='id,shortcutDetails').execute()
print('File ID: %s, Shortcut Target ID: %s, Shortcut Target MIME type: %s' % (
shortcut.get('id'),
shortcut.get('shortcutDetails').get('targetId'),
shortcut.get('shortcutDetails').get('targetMimeType')))
Node.js
var fileMetadata = {
'name': 'FILE_NAME',
'mimeType': 'text/plain'
};
drive.files.create({
'resource': fileMetadata,
'fields': 'id'
}, function (err, file) {
if (err) {
// Handle error
console.error(err);
} else {
console.log('File Id: ' + file.id);
shortcutMetadata = {
'name': 'SHORTCUT_NAME',
'mimeType': 'application/vnd.google-apps.shortcut'
'shortcutDetails': {
'targetId': file.id
}
};
drive.files.create({
'resource': shortcutMetadata,
'fields': 'id,name,mimeType,shortcutDetails'
}, function(err, shortcut) {
if (err) {
// Handle error
console.error(err);
} else {
console.log('Shortcut Id: ' + shortcut.id +
', Name: ' + shortcut.name +
', target Id: ' + shortcut.shortcutDetails.targetId +
', target MIME type: ' + shortcut.shortcutDetails.targetMimeType);
}
}
}
});
다음을 바꿉니다.
- FILE_NAME: 바로가기가 필요한 파일 이름입니다.
- SHORTCUT_NAME: 이 바로가기의 이름
기본적으로 바로가기는 현재 사용자의 내 드라이브에 생성되며 현재 사용자에게 액세스 권한이 있는 파일 또는 폴더에 대해서만 바로가기가 생성됩니다.
바로가기 검색
바로가기를 검색하려면 q
쿼리 문자열을 files.list
와 함께 사용하여 반환할 바로가기를 필터링합니다.
mimeType operator values
각 항목의 의미는 다음과 같습니다.
- query_term은 검색할 검색어 또는 필드입니다. 공유 드라이브를 필터링하는 데 사용할 수 있는 검색어는 검색어를 참고하세요.
- operator는 쿼리 용어의 조건을 지정합니다. 각 검색어와 함께 사용할 수 있는 연산자를 확인하려면 검색 연산자를 참고하세요.
- values는 검색 결과를 필터링하는 데 사용할 특정 값입니다.
예를 들어 다음 쿼리 문자열은 스프레드시트 파일의 모든 바로가기를 반환하도록 검색을 필터링합니다.
q: mimeType='application/vnd.google-apps.shortcut' AND shortcutDetails.targetMimeType='application/vnd.google-apps.spreadsheet'
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-29(UTC)
[null,null,["최종 업데이트: 2025-08-29(UTC)"],[],[],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'"]]