Prefix and Delimiter parameters limit the kind of results returned by a list operation. Prefix limits the results to those keys only which begins with the specified prefix whereas delimiters tend to list all keys that shares a common prefix in a single summary list result.
You can list objects in hierarchy using Prefix and Delimiter by sending Http
Request to Amazon S3, in one of the two below ways:
List objects with Prefix and Delimiter using Amazon S3 REST API - "GET Bucket" within your software code :
If you are a programmer, you can write your own code to list objects using Prefix and Delimiter with the help of AWS S3 REST or SOAP API. In this documentation, we are talking about the REST APIs only, you can refer to AWS S3 documentation for SOAP APIs.
List objects with Prefix and Delimiter using Bucket Explorer :
If you do not want to write code, you can easily list objects using Prefix and Delimiter with Bucket Explorer in few mouse clicks.
List Objects with Prefix and Delimiter using Amazon S3 REST API
To list some or all objects in a Bucket or to return a subset of the objects, you can request GET and use Prefix and Delimiter parameters and then browse your keys hierarchically.
Date: Wed, 01 Mar 2009 12:00:00 GMT
Authorization: AWS AKIAIOSFODNN7EXAMPLE:xQE0diMbLRepdf3YB+FIEXAMPLE=
In a single GET Bucket request, you get some or all (up to 1000) objects. In order to limit the results returned by the operation or to return a subset of the objects, you can use Request parameters as selection criteria such as Prefix and Delimeter. To authenticate the request, you must have READ access to the Bucket.
Search on Objects in a Bucket using Prefix and Delimeter with the help of Bucket Explorer
While the “GET Bucket” API allows you to get some or all of the objects in a Bucket and also allows you to limit the results returned by the operation using Prefix and Delimiter parameters by including and specifying the prefix and delimiter parameter in the code, Bucket Explorer lets you do that easily without the hassle of writing code.
You can Search by keywords to find or list
which have that keyword in the file name. This is an advance search option provided in Object Table in Bucket Explorer. By providing only few keywords (prefix or delimiter or both), we can search for a particular object in long object listing. These keywords make your search more specific and accurate.
You can view the searched objects list in
Full Path View
as well as in
by clicking on “Show Full Path” button in object toolbar. You can view your searched information below the object toolbar in this format “
Searched for prefix:
”. Search session continues until you
refresh object list
or bucket list.
If you search with option
Search By Prefix
, you will see details in searched results like last modified date, etc. On the other hand, searching with option Prefix and Delimiter will not show you such object details like last modified date, etc.
Steps to search objects in Bucket:
Run Bucket Explorer.
button in object table toolbar.
You will find two ways to search objects. These are
Search By Prefix
Search By Prefix and Delimiter
A dialog box for search will appear according to the selected search option.
If you are at any directory level and you click on
button, then directory name is shown as non-editable text with suffix
in prefix text box.
Now give some value in
(starting character sequence of file or folder) text field OR in
(Ending character sequence of file or folder) text field OR in both and click on
This will only give those folders and files that start with the given Prefix and end by Delimiter at root level. If any files and folders are in any folder, then search result will only show folders.
On search result, if you explore any folder or directory OR back from any directory level up, then object list table will show objects according to your search criteria.
The prefix can be anything from a partial string or single character up to the entire name of an object. Only objects with keys that start with the prefix will be listed. If object keys are divided into logical “directories” in your S3 account using forward-slashes (/), or indeed any character, only the contents of a “directory” can be displayed by using the directory name and the slash (e.g. “Documents/”).
Only objects with keys that match the prefix (if it is set) and end with the delimiter will be displayed. The delimiter is most useful when your object keys are divided into logical “directories” separated by a character such as forward-slash (/). In this case, specifying “/” as the delimiter will limit the object listing to only the top-level items or directories.
If you have a Bucket that contains the following keys:
A list query with
would return the keys and "subdirectories" at the photos/2006 level which starts with ="photos/2006/” and ended with “/” (as January, February,… are folders) but would not include any of the .jpg keys at deeper levels.
A list query with
would return the keys and "subdirectories" at the photos/2006 level which starts with “photos/2006/” and ended with “.html” (index.html & March, April…..are subdirectories containing .html file(s)).
A list query with
would return the keys and "subdirectories" at the photos/2006 level that starts with “photos/2006/” and ended with “.jpg” (img1001.jpg, January, February….are subdirectories contains that .jpg file(s)).
: As we search some objects, it will list the searched object at object table and a button
“Switch to object list”
will appear in object toolbar. Clicking on this button switches you to S3 object list from searched object list.