Skip to content
This repository has been archived by the owner on Feb 12, 2021. It is now read-only.

NoSuchKey when trying to use client.moveObject #200

Open
mexin opened this issue Mar 1, 2018 · 0 comments
Open

NoSuchKey when trying to use client.moveObject #200

mexin opened this issue Mar 1, 2018 · 0 comments

Comments

@mexin
Copy link

mexin commented Mar 1, 2018

Im having trouble moving files using .moveObject... I have added the parameters like this, but still every time I get the same error message, file is indeed in the bucket as I use client.listObjects(params) to get the Key and send it to client.moveObject(params) CopySource

const params = {
        Bucket: 'bucket-name',
        CopySource: `bucket-name/${fileKey}`,
        Key: fileKey.replace(oldPrefix, newPrefix),
    };
    const moveFile = client.moveObject(params);

** Editted
My files had "+" on them so I had to use encodeURIComponent() and that seems to solved it, now Im getting MethodNotAllowed: The specified method is not allowed against this resource. which seems its due client.deleteObject() did I miss anything?

Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant