Blog Home
>
>
How do I upload files to IPFS?
How do I upload files to IPFS?

How do I upload files to IPFS?

3
Min read
How do I upload files to IPFS?
Explore multiple methods to upload files to IPFS - from local nodes to cloud infrastructure or the ease of Pinata's Pinning Service.

Usually when you think of uploading files your mind will go to a service like Dropbox, Google Drive, or maybe even S3. However, if you are working in Web3, you might think of IPFS for a lot of good reasons. It pairs perfectly with blockchain technology, filling the gaps of expensive on chain storage while keeping an immutable state and verification through the CID (learn more about that here). But how do you get started? What’s the easiest way to upload files to IPFS? In this post we’ll show you a few ways and weigh out their advantages.

Using a Local IPFS Node

One way you can access IPFS is with a local IPFS node using an application like IPFS Desktop. Typically you would want to use this for personal use, not developing decentralized applications. This is an app you can run on your computer for Windows or Mac, and is relatively simple to use. All you have to do is visit their downloads page, install it, fire it up, then add some files.

Once you add some files you can see the CID for each file and access through a public gateway like <span class="code-inline">https://ipfs.io/ipfs/{CID}</span>. There are some disadvantages to this method though. One of them is that you have to keep the local node running 24/7 for files to be available, which means you have to keep your computer running too. Not ideal if you need consistent availability. The app can also tend to be slow and a bit clunky.

Cloud IPFS Nodes

If you’re a developer that is trying to build apps and you need consistent availability, you could look into running IPFS nodes in the cloud. This could take the form of a server running IPFS Kubo, a client written in Go. With this option you would have the advantage of completely customization. However setting this up would be much more difficult, as you would need to have quite a bit of cloud infrastructure experience and you would have to build an API to interact with it to upload files. Not only that, but IPFS infrastructure can be incredibly challenging to scale properly (not to mention possible abuse you may encounter). This is why most developers go with the next option.

IPFS Pinning Services

An IPFS Pinning Service like Pinata can help both developer and non-technical people alike as it makes IPFS just work. We’ve been scaling IPFS infrastructure for years so you don’t have to, keeping your IPFS content available, stable, and secure. To upload a file to Pinata,  just create a free account, click the “add files” button in the top right, choose your file, then upload. That easy!

If you’re a developer Pinata offers a easy and accessible REST API, SDK, and even a Next.js template to help you hit the ground running with developing on IPFS. Uploading a file to IPFS using the Pinata SDK just takes a few lines of code.

const fs = require('fs');
const pinataSDK = require('@pinata/sdk');
const pinata = new pinataSDK({ pinataJWTKey: 'yourPinataJWTKey'});

const stream = fs.createReadStream('./yourfile.png');
const res = await pinata.pinFileToIPFS(stream)

Uploading to IPFS is really just the tip of the iceberg of what you can get with Pinata. Developers and individuals alike can enjoy also our Dedicated Gateways revolutionized the way people retrieve content from the IPFS network at blazing speeds and a built in CDN (which are now included on our free plan 👀). So what are you waiting for? Go ahead and sign up and try uploading a file to IPFS today!

Happy pinning!

3
MIN READ

H1 - THE RICH TEXT
EXAMPLE STARTS HERE

H2 - Enabling Widespread Adoption for Music NFTs

paragraph — The first thing the music industry needs is more exposure. For artists, listeners and yeah, the labels. Even with the use cases mentioned above, the majority of the music industry still sees NFTs as a novelty rather than a legitimate way to run a business. We see a future where the experience is built and monetized on the blockchain, with labels taking part of the experience, as well.

Second, there needs to be a big jump in user experience. Listeners know what to expect with Spotify and Apple Music: a smooth, intuitive experience that lets them listen to Lil Nas X with just a few clicks. Web3 platforms aren’t quite there. Music NFTs and related premium content require extra steps that most people don’t yet have an appetite for.

H3 - How Could Music NFTs Save Artists?

paragraph — Musician Daniel Allan spent months building a relationship with the NFT community and raised 50 ETH to fund his new album, Overstimulated. Companies like Audius and artists like Vérité's, who raised $90,000 in an NFT launch, are at the forefront of exploring new ways to get paid. Avenged Sevenfold launched an NFT collection called "Deathbats Club" with 10,000 items that grants holders access to benefits such as meet and greets at shows, lifetime free tickets, limited edition merchandise, and more.

Photo of ETHDenver 2022 with Pinata employees
This can also be styled!! Image caption.

H4 - Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

H5 — How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.

LINK — This is how a link looks like. Please provide normal & hover state (if different than this)

  • This will be bullet points
  • Numbered list is the same but with numbers
  • It has a margin-left applied
  1. Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.
  2. Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.
  3. Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.
QUOTE — Everyone is obsessed with making money and seeking alpha, which does a disservice to what [NFTs] can actually do. We have been instructing many bands that NFTs are a ticket for access to an exclusive club.” - M. Shadows, Avenged Sevenfold’s lead singer.