Retrieves the metadata and status of a previously uploaded file.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/googleapis/python-genai/llms.txt
Use this file to discover all available pages before exploring further.
Method Signature
Parameters
The file resource name to retrieve.Format:
"files/abc123" or just "abc123"The name is returned when you upload a file using files.upload().Optional configuration for the request.Available options:
http_options: Custom HTTP request options
Returns
A File object containing:
name: The resource nameuri: The URI to use in API callsdisplay_name: Human-readable namemime_type: File MIME typesize_bytes: File sizecreate_time: Upload timestampupdate_time: Last update timestampexpiration_time: When the file expiresstate: Current state (PROCESSING,ACTIVE, orFAILED)sha256_hash: SHA-256 hash of the file
Examples
Get File by Name
Check File Processing Status
Get File with Short Name
Use Retrieved File in Prompt
Get File Details After Upload
Async Get
Verify File Before Using
Check Multiple Files
File States
Files can be in three states:
- PROCESSING: File is being processed (e.g., video encoding)
- ACTIVE: File is ready to use in API calls
- FAILED: File processing failed
Error Handling
API Availability
Related Methods
- files.upload - Upload a new file
- files.list - List all uploaded files
- files.delete - Delete a file