-1

Possible Duplicate:
Rails or Django? (or something else?)
Amazon S3 boto: how to rename a file in a bucket?

I am using this: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html

I need to rename a file, how can I do that?

I searched the docs thoroughly and couldn't find anything.

Community
  • 1
  • 1
azio
  • 575
  • 1
  • 6
  • 12
  • Perhaps that has been changed in the past two years? – azio Dec 10 '12 at 02:34
  • 2
    You can see the underlying operations exposed by S3 here: http://docs.amazonwebservices.com/AmazonS3/latest/API/RESTObjectOps.html -- the only basic operations exposed are upload, download and delete. – James Henstridge Dec 10 '12 at 02:38

2 Answers2

6

You may use copy operation see http://docs.amazonwebservices.com/AmazonS3/latest/dev/CopyingObjectsExamples.html. Using the copy operation, you can:

  • Create additional copies of objects

  • Rename objects by copying them and deleting the original ones

  • Move objects across Amazon S3 locations (e.g., Northern California and EU)

SubRed
  • 3,169
  • 1
  • 18
  • 17
  • In the original question, @azio mentioned using django-storages. Using S3 via django-storage you cannot rename the file in S3. That must be done independently using the above techniques. – elarson Oct 04 '14 at 06:19
3

SubRed is absolutely correct to rename then S3 Object.

If you do this without writing a single line of code then you can use Bucket Explorer, It does rename the complete folder (all objects start with common prefix end with "/").

[Disclosure : I am developer of Bucket Explorer]

Tej Kiran
  • 2,218
  • 5
  • 21
  • 42