You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note the trailing slash `/`-if you had requested `list({ path : 'photos' })` it would also match against files like `photos123.jpg` alongside `photos/123.jpg`.
51
45
@@ -63,9 +57,9 @@ The format of the response will look similar to the below example:
63
57
// ...
64
58
],
65
59
}
66
-
```
67
-
{/* in other files we're referring to paths instead of folders, can we be consistent on terminology? */}
68
-
Manually created folders will show up as files with a `size` of 0, but you can also match keys against a regex like `file.key.match(/\.[0-9a-z]+$/i)` to distinguish files from folders. Since "folders" are a virtual concept in Amazon S3, any file may declare any depth of folder just by having a `/` in its name.
60
+
````
61
+
62
+
{/* in other files we're referring to paths instead of folders, can we be consistent on terminology? */} Manually created folders will show up as files with a `size` of 0, but you can also match keys against a regex like `file.key.match(/\.[0-9a-z]+$/i)` to distinguish files from folders. Since "folders" are a virtual concept in Amazon S3, any file may declare any depth of folder just by having a `/` in its name.
69
63
70
64
To access the contents and subpaths of a "folder", you have two options:
71
65
@@ -161,13 +155,13 @@ The response will include only the objects within the `photos/` path and will al
161
155
162
156
The default delimiter character is '/', but this can be changed by supplying a custom delimiter:
163
157
164
-
```js
165
-
constresult=awaitlist({
158
+
```ts title="src/main.ts"
159
+
constresult=awaitlist({
166
160
// Path uses '-' character to organize files rather than '/'
167
-
path:"photos-",
168
-
options:{
169
-
subpathStrategy: {
170
-
strategy:'exclude',
161
+
path:'photos-',
162
+
options:{
163
+
subpathStrategy: {
164
+
strategy:'exclude',
171
165
delimiter:'-'
172
166
}
173
167
}
@@ -176,8 +170,8 @@ const result = await list({
176
170
177
171
### More `list` options
178
172
179
-
Option | Type | Description |
180
-
| -- | -- |----------- |
173
+
| Option | Type | Description |
174
+
| --- | --- | --- |
181
175
| listAll | boolean | Set to true to list all files within the specified `path` |
182
176
| pageSize | number | Sets the maximum number of files to be return. The range is 0 - 1000 |
183
177
| nextToken | string | Indicates whether the list is being continued on this bucket with a token |
@@ -307,7 +301,7 @@ You can list all of the objects uploaded under a given path by setting the `page
307
301
```swift
308
302
let options =StorageListRequest.Options(pageSize:1000)
309
303
let listResult =tryawaitAmplify.Storage.list(
310
-
path: .fromString("public/example/path"),
304
+
path: .fromString("public/example/path"),
311
305
options: options
312
306
)
313
307
listResult.items.forEach { item in
@@ -323,7 +317,7 @@ listResult.items.forEach { item in
323
317
let sink =Amplify.Publisher.create {
324
318
let options =StorageListRequest.Options(pageSize:1000)
325
319
tryawaitAmplify.Storage.list(
326
-
path: .fromString("public/example/path"),
320
+
path: .fromString("public/example/path"),
327
321
options: options
328
322
)
329
323
}.sink {
@@ -345,18 +339,19 @@ receiveValue: { listResult in
345
339
346
340
### More `list` options
347
341
348
-
Option | Type | Description |
349
-
| -- | -- |----------- |
342
+
| Option | Type | Description |
343
+
| --- | --- | --- |
350
344
| pageSize | UInt | Number between 1 and 1,000 that indicates the limit of how many entries to fetch when retrieving file lists from the server |
351
345
| nextToken | String | String indicating the page offset at which to resume a listing. |
352
-
346
+
353
347
</InlineFilter>
354
348
355
349
<InlineFilter filters={["flutter"]}>
356
350
357
351
This will list all files located under path `album` that:
358
-
* have `private` access level
359
-
* are in the root of `album/` (the result doesn't include files under any sub path)
352
+
353
+
- have `private` access level
354
+
- are in the root of `album/` (the result doesn't include files under any sub path)
0 commit comments