Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6692105
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:49:44+00:00 2026-05-26T05:49:44+00:00

I’m wondering how to do this. I looked at the sdk documentation and have

  • 0

I’m wondering how to do this. I looked at the sdk documentation and have some examples, but am confused how the syntax generally goes.

If I want to delete a file, I assume I use deleteObject(path, key). However, what is the “key”?

Also how do you delete a directory? I can’t seem to find a method for doing that.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:49:45+00:00Added an answer on May 26, 2026 at 5:49 am

    A “key” in S3 is similar to a file path:

    http://bucket.s3.amazonaws.com/some/path/to/use
    

    … is in a bucket named bucket and has a key of some/path/to/use.

    It’s not actually a path though, because there are no folders. The S3 key is just the file name for a file in one big directory (the entire bucket). S3 keys can contain /, but it has no special meaning unless you set the delimiter argument with listing a bucket.

    In other words, having an object named some/object doesn’t tell you anything about the object some (it might or might not exist — the two objects are not related).

    However, you can request keys with a specific prefix, so I could say “give me all keys starting with some/path/to/ and it will return some/path/to/use. It looks like “listing a directory”, but it’s really just asking for files that start with a specific string of characters.

    I could just as easily name things like this:

    somepathtousea
    somepathtouseb
    

    And say “give me everything starting with somepathtouse” (and it would say somepathtousea and somepathtouseb).

    Note: S3 URL’s come in several forms:

    http://s3.amazonaws.com/bucket/key
    http://bucket.s3.amazonaws.com/key
    http://bucket/key (where bucket is a DNS CNAME record pointing to bucket.s3.amazonaws.com)
    

    EDIT:

    I looked at the JavaDocs and this is the function signature I see (for AmazonS3Client):

    public void deleteObject(java.lang.String bucketName,
                             java.lang.String key)
                      throws AmazonClientException,
                             AmazonServiceException
    

    EDIT again:

    Folders do kind-of exist now, as zero-length objects with a content-type of application/x-directory and a key ending in /:

    $ AWS_PROFILE=prod aws s3api head-object --bucket example-bucket --key example-directory/
    {
        "AcceptRanges": "bytes",
        "LastModified": "Mon, 29 Apr 2019 14:59:36 GMT",
        "ContentLength": 0,
        "ETag": "\"d41d8cd98f00b204e9800998ecf8427e\"",
        "ContentType": "application/x-directory",
        "ServerSideEncryption": "AES256",
        "Metadata": {}
    }
    

    This is still just convention and there’s nothing stopping you from having files ending / or files inside of “folders” that don’t exist.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I have some data like this: 1 2 3 4 5 9 2 6
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.