Upload
file
Upload a single file to Pinata
HTML uploads are currently only available on paid plans with granted access. If you are on a paid plan and wish to upload HTML please send a request through our support chat or send an email to [email protected]
Usage
Local Files
If you need to upload files from a local file source you can use fs
to feed a file into a blob
, then turn that blob
into a File
.
Returns
Parameters
file
- Type:
File
object
Accepts a File object in accordance with the W3C File API.
In most environments you can also pass a Blob here as well.
addMetadata (Optional)
- Type: PinataMetadata
Add optional metadata to file
group (Optional)
- Type:
string
Upload to a specific group by passing in the groupId
key (Optional)
- Type:
string
Upload a file using a secondary API key generated through keys.create()
cidVersion (Optional)
- Type:
0 | 1
Specificy CID version for upload