diff --git a/attractsdk/files.py b/attractsdk/files.py index 9db8b22..0ea1130 100755 --- a/attractsdk/files.py +++ b/attractsdk/files.py @@ -13,6 +13,7 @@ class File(List, Find, Create, Post, Update, Delete, Replace): """ path = "files" file_server_path = "file_server/file" + build_previews_server_path = "file_server/build_previews" def post_file(self, file_path, name=None, api=None): """Stores a file on the database or static folder. @@ -27,3 +28,12 @@ class File(List, Find, Create, Post, Update, Delete, Replace): # self.error = None # self.merge(new_attributes) return self.success() + + def build_previews(self, path, api=None): + """Stores a file on the database or static folder. + :param path: A file path + """ + api = api or self.api + url = utils.join_url(self.build_previews_server_path, path) + api.get(url) + return self.success()