2

I am trying to completely move file from one folder to another folder completly(similar action we do 'cut and past to another folder') using boto3 method

    
    s3_client = boto3.resource('s3')
    bucket='mybucket'
    source = {
    'Bucket': bucket,
    'Key': 'some key'
    }
    s3_client.meta.client.copy(source,bucket, 'my/destination_file_path')

The above code perfectly copy the file from source to destination path, but it does not moving(not cut/delete the file and move to another folder)

i found and used below method to delete the file after it copied, but i want to move entire file without using the 'delete' method. The reason is i want to ensure the file is moved completely

s3_client.Object(bucket,source).delete()
adhi hari
  • 41
  • 1
  • 9

0 Answers0