Properties
The name/key of the file in the S3 bucket
The S3 object key/path
The S3 bucket name where the file is stored
The AWS region where the S3 bucket is located
Optional custom S3 endpoint URL. Defaults to undefined for standard AWS S3
A human-readable filename suggestion for downloads or display
The file type of the file
Methods
toJSON
toJSON
Returns a JSON-serializable record representation of the file.Returns:
Record<string, string>Complete model data including all fieldstoDict
toDict
Converts the file metadata to a record.Returns:
Record<string, string>Record with fileName, key, bucket, region, endpoint, suggestedFileName, and fileTypegetS3Key
getS3Key
Returns the full S3 URL for the file.Returns:
stringComplete S3 URL in format: https://bucket.s3.region.amazonaws.com/filenamegetFilePath
getFilePath
Returns the file path/key within the S3 bucket.Returns:
stringThe fileName property (S3 object key)getSignedUrl
getSignedUrl
Generates a presigned URL for secure, temporary access to the file.Returns:
URL expiration time in seconds. Defaults to 432000 (5 days)
Promise<string>Presigned URL for downloading the file