{
  "doc": {
    "id": "api/utilities/buffer",
    "title": "Cypress.Buffer | Cypress Documentation",
    "description": "Cypress automatically includes a Buffer polyfill for the browser and exposes it as `Cypress.Buffer`.",
    "section": "api",
    "source_path": "/llm/markdown/api/utilities/buffer.md",
    "version": "48b03b5502f7aea1d0454750cce208f775403542",
    "updated_at": "2026-05-20T19:00:20.270Z",
    "headings": [
      {
        "id": "api/utilities/buffer#cypress-buffer",
        "text": "Cypress.Buffer",
        "level": 1
      },
      {
        "id": "api/utilities/buffer#syntax",
        "text": "Syntax",
        "level": 2
      },
      {
        "id": "api/utilities/buffer#usage",
        "text": "Usage",
        "level": 3
      },
      {
        "id": "api/utilities/buffer#examples",
        "text": "Examples",
        "level": 2
      },
      {
        "id": "api/utilities/buffer#loading-binary-data-read-from-disk",
        "text": "Loading binary data read from disk",
        "level": 3
      },
      {
        "id": "api/utilities/buffer#using-dynamic-file-contents-with-selectfile",
        "text": "Using dynamic file contents with .selectFile()",
        "level": 3
      },
      {
        "id": "api/utilities/buffer#history",
        "text": "History",
        "level": 2
      },
      {
        "id": "api/utilities/buffer#see-also",
        "text": "See also",
        "level": 2
      }
    ]
  },
  "chunks": [
    {
      "id": "api/utilities/buffer#examples",
      "doc_id": "api/utilities/buffer",
      "heading": "Examples",
      "heading_level": 2,
      "content_markdown": "## Examples\n\n### Loading binary data read from disk\n\n```\ncy.readFile('images/logo.png', null).then((file) => {  expect(Cypress.Buffer.isBuffer(file)).to.be.true  // Do something with `file` Buffer here})\n```\n\n### Using dynamic file contents with `.selectFile()`\n\n```\nconst files = []for (var i = 1; i <= 10; i++) {  files.push(Cypress.Buffer.from(`Contents of file #${i}`))}// Attach 10 files, of the form \"Contents of file #1\", \"Contents of file #2\", etc.cy.get('input[type=file]').selectFile(files)\n```\n",
      "section": "api",
      "anchors": [
        "examples"
      ],
      "path": "/llm/json/chunked/api/utilities/buffer.json",
      "token_estimate": 85
    },
    {
      "id": "api/utilities/buffer#using-dynamic-file-contents-with-selectfile",
      "doc_id": "api/utilities/buffer",
      "heading": "Using dynamic file contents with .selectFile()",
      "heading_level": 3,
      "content_markdown": "### Using dynamic file contents with `.selectFile()`\n\n```\nconst files = []for (var i = 1; i <= 10; i++) {  files.push(Cypress.Buffer.from(`Contents of file #${i}`))}// Attach 10 files, of the form \"Contents of file #1\", \"Contents of file #2\", etc.cy.get('input[type=file]').selectFile(files)\n```\n",
      "section": "api",
      "anchors": [
        "using-dynamic-file-contents-with-selectfile"
      ],
      "path": "/llm/json/chunked/api/utilities/buffer.json",
      "token_estimate": 55
    }
  ]
}