Skip to content

Commit 644ccb2

Browse files
committed
Add replace=False to upload_local_file_to_custom_folder()
1 parent b9de89f commit 644ccb2

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎seatable_api/main.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1255,7 +1255,7 @@ def download_custom_file(self, path, save_path):
12551255
f.write(response.content)
12561256

12571257
@check_auth
1258-
def upload_local_file_to_custom_folder(self, local_path, custom_folder_path = None, name=None, ):
1258+
def upload_local_file_to_custom_folder(self, local_path, custom_folder_path = None, name=None, replace=False):
12591259
if not name:
12601260
name = local_path.strip('/').split('/')[-1]
12611261
if not custom_folder_path:
@@ -1269,7 +1269,7 @@ def upload_local_file_to_custom_folder(self, local_path, custom_folder_path = No
12691269
response = requests.post(upload_link, data={
12701270
'parent_dir': parent_path,
12711271
'relative_path': relative_path,
1272-
'replace': 0
1272+
'replace': 1 if replace else 0
12731273
}, files={
12741274
'file': (name, open(local_path, 'rb'))
12751275
}, timeout=self.timeout)

0 commit comments

Comments
 (0)