How to list files uploaded to web3.storage
In this how-to guide, you'll learn about the different ways that you can list the files that you've uploaded to web3.storage. Once you've stored some files using web3.storage, you'll want to see a list of what you've uplodaded. There are two ways you can do this:
Using the web3.storage website
You can see a list of everything you've uploaded to web3.storage on the Files page on the web3.storage website. If you don't need to work with this list programmatically, using the website may be a simpler choice.
This Files page provides a convenient overview of your stored data, including links to view your files in your browser via an IPFS gateway and information about how the data is being stored on the decentralized storage networks that web3.storage uses under the hood.
Using the w3up-client
library
To easily integrate web3.storage programmatically in your apps or services, you can also access a listing of your uploads from your code using the w3up
client. In the example below, this guide walks through how to use the JavaScript client library to fetch a complete listing of all the data you've uploaded using web3.storage.
Installing the client
In your JavaScript project, add the w3up-client
package to your dependencies:
npm install w3up-client
Creating a client instance
To create a w3up
client object, we need to pass some configuration settings into the constructor:
TODO: snippet of client creation (or link to same)
Listing your uploads
The w3up
client object's list
method returns an async iterable that can be used with the for await
syntax to read information about each upload as soon as it's received over the network.
Here's an example that logs details about each upload to the console:
TODO: new code snippet to list & print CIDs
Pagination & filtering
TODO: pagination details
TODO: audit link targets