I am trying to upload a lot of files from S3 to IPFS via Pinata. I haven't found in Pinata documentation something like that.
This is my solution, using the form-data library. I haven't tested it yet (I will do it soon, I need to code some things).
Is it a correct approach? anyone who has done something similar?
async uploadImagesFolder(
    items: ItemDocument[],
    bucket?: string,
    path?: string,
  ) {
    try {
      const form = new FormData();
      for (const item of items) {
        const file = getObjectStream(item.tokenURI, bucket, path);
        form.append('file', file, {
          filename: item.tokenURI,
        });
      }
      console.log(`Uploading files to IPFS`);
      const pinataOptions: PinataOptions = {
        cidVersion: 1,
      };
      const result = await pinata.pinFileToIPFS(form, {
        pinataOptions,
      });
      console.log(`Piñata Response:`, JSON.stringify(result, null, 2));
      return result.IpfsHash;
    } catch (e) {
      console.error(e);
    }
  }