|
|
@ -398,8 +398,8 @@ func (handler *Driver) Token(ctx context.Context, ttl int64, uploadSession *seri
|
|
|
|
|
|
|
|
|
|
|
|
// Meta 获取文件信息
|
|
|
|
// Meta 获取文件信息
|
|
|
|
func (handler *Driver) Meta(ctx context.Context, path string) (*MetaData, error) {
|
|
|
|
func (handler *Driver) Meta(ctx context.Context, path string) (*MetaData, error) {
|
|
|
|
res, err := handler.svc.GetObject(
|
|
|
|
res, err := handler.svc.HeadObject(
|
|
|
|
&s3.GetObjectInput{
|
|
|
|
&s3.HeadObjectInput{
|
|
|
|
Bucket: &handler.Policy.BucketName,
|
|
|
|
Bucket: &handler.Policy.BucketName,
|
|
|
|
Key: &path,
|
|
|
|
Key: &path,
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -407,7 +407,6 @@ func (handler *Driver) Meta(ctx context.Context, path string) (*MetaData, error)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
defer res.Body.Close()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return &MetaData{
|
|
|
|
return &MetaData{
|
|
|
|
Size: uint64(*res.ContentLength),
|
|
|
|
Size: uint64(*res.ContentLength),
|
|
|
|