aboutsummaryrefslogtreecommitdiffstats
path: root/mediagoblin/storage/cloudfiles.py
diff options
context:
space:
mode:
Diffstat (limited to 'mediagoblin/storage/cloudfiles.py')
-rw-r--r--mediagoblin/storage/cloudfiles.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/mediagoblin/storage/cloudfiles.py b/mediagoblin/storage/cloudfiles.py
index 250f06d4..47c81ad6 100644
--- a/mediagoblin/storage/cloudfiles.py
+++ b/mediagoblin/storage/cloudfiles.py
@@ -168,6 +168,12 @@ class CloudFilesStorage(StorageInterface):
# Copy to storage system in 4096 byte chunks
dest_file.send(source_file)
+ def get_file_size(self, filepath):
+ """Returns the file size in bytes"""
+ obj = self.container.get_object(
+ self._resolve_filepath(filepath))
+ return obj.total_bytes
+
class CloudFilesStorageObjectWrapper():
"""
Wrapper for python-cloudfiles's cloudfiles.storage_object.Object