Method: files.download
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
파일의 콘텐츠를 다운로드합니다. 자세한 내용은 파일 다운로드 및 내보내기를 참고하세요.
작업은 생성 시점부터 24시간 동안 유효합니다.
HTTP 요청
POST https://www.googleapis.com/drive/v3/files/{fileId}/download
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
fileId |
string
필수입니다. 다운로드할 파일의 ID입니다.
|
쿼리 매개변수
매개변수 |
mimeType |
string
선택사항입니다. 파일을 다운로드할 MIME 유형입니다. 이 필드는 Google Workspace 문서를 다운로드할 때만 설정할 수 있습니다. 지원되는 MIME 유형 목록은 Google Workspace 문서의 내보내기 MIME 유형을 참고하세요. 설정하지 않으면 기본 MIME 유형으로 Google Workspace 문서가 다운로드됩니다. 기본 MIME 유형은 향후 변경될 수 있습니다.
|
revisionId |
string
선택사항입니다. 다운로드할 파일의 버전 ID입니다. 이 필드는 blob 파일, Google Docs, Google Sheets를 다운로드할 때만 설정할 수 있습니다. 파일의 특정 버전을 다운로드하는 것이 지원되지 않는 경우 INVALID_ARGUMENT 를 반환합니다.
|
응답 본문
성공한 경우 응답 본문에 Operation
의 인스턴스가 포함됩니다.
승인 범위
다음 OAuth 범위 중 하나가 필요합니다.
https://www.googleapis.com/auth/drive
https://www.googleapis.com/auth/drive.file
https://www.googleapis.com/auth/drive.readonly
일부 범위는 제한되어 있으며 앱에서 이를 사용하려면 보안 평가가 필요합니다. 자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-08-27(UTC)
[null,null,["최종 업데이트: 2025-08-27(UTC)"],[],[],null,["# Method: files.download\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\nDownloads content of a file. Operations are valid for 24 hours from the time of creation.\n\n### HTTP request\n\n`POST https://www.googleapis.com/drive/v3/files/{fileId}/download`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|----------------------------------------------------|\n| `fileId` | `string` Required. The ID of the file to download. |\n\n### Query parameters\n\n| Parameters ||\n|--------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `mimeType` | `string` Optional. The MIME type the file should be downloaded as. This field can only be set when downloading Google Workspace documents. See [files.export MIME types for Google Workspace documents](/drive/api/guides/ref-export-formats) for the list of supported MIME types. If not set, a Google Workspace document is downloaded with a default MIME type. The default MIME type might change in the future. |\n| `revisionId` | `string` Optional. The revision ID of the file to download. This field can only be set when downloading blob files, Google Docs, and Google Sheets. Returns `INVALID_ARGUMENT` if downloading a specific revision on the file is unsupported. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains an instance of [Operation](/workspace/drive/api/reference/rest/v3/operations#Operation).\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.file`\n- `\n https://www.googleapis.com/auth/drive.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)."]]